27 #include "BlockCipher.h"
39 bool setKey(
const uint8_t *key,
size_t len);
40 bool setIV(
const uint8_t *iv,
size_t len);
42 void encrypt(uint8_t *output,
const uint8_t *input,
size_t len);
43 void decrypt(uint8_t *output,
const uint8_t *input,
size_t len);
Abstract base class for stream ciphers.
CTR()
Constructs a new CTR object for the 128-bit block cipher T.
Abstract base class for block ciphers.
void setBlockCipher(BlockCipher *cipher)
Sets the block cipher to use for this CTR object.
bool setIV(const uint8_t *iv, size_t len)
Sets the initial counter value to use for future encryption and decryption operations.
bool setCounterSize(size_t size)
Sets the counter size for the IV.
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
CTRCommon()
Constructs a new cipher in CTR mode.
size_t keySize() const
Default size of the key for this cipher, in bytes.
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Implementation of the Counter (CTR) mode for 128-bit block ciphers.
void clear()
Clears all security-sensitive state from this cipher.
Concrete base class to assist with implementing CTR mode for 128-bit block ciphers.