27 #include "BlockCipher.h"
37 bool setKey(
const uint8_t *key,
size_t len);
38 bool setIV(
const uint8_t *iv,
size_t len);
40 void encrypt(uint8_t *output,
const uint8_t *input,
size_t len);
41 void decrypt(uint8_t *output,
const uint8_t *input,
size_t len);
Abstract base class for block ciphers.
Concrete base class to assist with implementing CBC for 128-bit block ciphers.
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
void setBlockCipher(BlockCipher *cipher)
Sets the block cipher to use for this CBC object.
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
virtual ~CBCCommon()
Destroys this cipher object after clearing sensitive information.
CBCCommon()
Constructs a new cipher in CBC mode.
void clear()
Clears all security-sensitive state from this cipher.
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
bool setIV(const uint8_t *iv, size_t len)
Sets the initialization vector to use for future encryption and decryption operations.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
size_t keySize() const
Default size of the key for this cipher, in bytes.
Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers.
CBC()
Constructs a new CBC object for the block cipher T.
Abstract base class for stream ciphers.