23 #ifndef CRYPTO_ASCON128_H
24 #define CRYPTO_ASCON128_H
26 #include "AuthenticatedCipher.h"
38 bool setKey(
const uint8_t *key,
size_t len);
39 bool setIV(
const uint8_t *iv,
size_t len);
41 void encrypt(uint8_t *output,
const uint8_t *input,
size_t len);
42 void decrypt(uint8_t *output,
const uint8_t *input,
size_t len);
47 bool checkTag(
const void *tag,
size_t len);
59 void permute(uint8_t first);
ASCON-128 authenticated cipher.
Ascon128()
Constructs a new Ascon128 authenticated cipher.
size_t keySize() const
Gets the size of the Ascon128 key in bytes.
size_t tagSize() const
Gets the size of the Ascon128 authentication tag 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 encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext 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.
void clear()
Clears all security-sensitive state from this cipher object.
bool checkTag(const void *tag, size_t len)
Finalizes the decryption process and checks the authentication tag.
virtual ~Ascon128()
Destroys this Ascon128 authenticated cipher.
void addAuthData(const void *data, size_t len)
Adds extra data that will be authenticated but not encrypted.
void computeTag(void *tag, size_t len)
Finalizes the encryption process and computes the authentication tag.
size_t ivSize() const
Gets the size of the Ascon128 initialization vector in bytes.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Abstract base class for authenticated ciphers.