23 #ifndef CRYPTO_CHACHAPOLY_H 
   24 #define CRYPTO_CHACHAPOLY_H 
   26 #include "AuthenticatedCipher.h" 
   40     bool setKey(
const uint8_t *key, 
size_t len);
 
   41     bool setIV(
const uint8_t *iv, 
size_t len);
 
   43     void encrypt(uint8_t *output, 
const uint8_t *input, 
size_t len);
 
   44     void decrypt(uint8_t *output, 
const uint8_t *input, 
size_t len);
 
   49     bool checkTag(
const void *tag, 
size_t len);
 
Abstract base class for authenticated ciphers.
Authenticated cipher based on ChaCha and Poly1305.
ChaChaPoly()
Constructs a new ChaChaPoly authenticated cipher.
void clear()
Clears all security-sensitive state from this cipher.
bool setIV(const uint8_t *iv, size_t len)
Sets the initialization vector to use for future encryption and decryption operations.
size_t keySize() const
Default size of the key for this cipher, in bytes.
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
void addAuthData(const void *data, size_t len)
Adds extra data that will be authenticated but not encrypted.
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
virtual ~ChaChaPoly()
Destroys this ChaChaPoly authenticated cipher.
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
size_t tagSize() const
Returns the size of the authentication tag.
void computeTag(void *tag, size_t len)
Finalizes the encryption process and computes the authentication tag.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
bool checkTag(const void *tag, size_t len)
Finalizes the decryption process and checks the authentication tag.
Poly1305 message authenticator.