23 #ifndef CRYPTO_BLOCKCIPHER_h
24 #define CRYPTO_BLOCKCIPHER_h
36 virtual size_t keySize()
const = 0;
38 virtual bool setKey(
const uint8_t *key,
size_t len) = 0;
40 virtual void encryptBlock(uint8_t *output,
const uint8_t *input) = 0;
41 virtual void decryptBlock(uint8_t *output,
const uint8_t *input) = 0;
43 virtual void clear() = 0;
Abstract base class for block ciphers.
BlockCipher()
Constructs a block cipher.
virtual ~BlockCipher()
Destroys this block cipher object.
virtual void decryptBlock(uint8_t *output, const uint8_t *input)=0
Decrypts a single block using this cipher.
virtual void encryptBlock(uint8_t *output, const uint8_t *input)=0
Encrypts a single block using this cipher.
virtual bool setKey(const uint8_t *key, size_t len)=0
Sets the key to use for future encryption and decryption operations.
virtual void clear()=0
Clears all security-sensitive state from this block cipher.
virtual size_t blockSize() const =0
Size of a single block processed by this cipher, in bytes.
virtual size_t keySize() const =0
Default size of the key for this block cipher, in bytes.