29 #if defined(CRYPTO_AES_ESP32)
33 int esp_aes_setkey(
unsigned char *ctx,
const unsigned char *key,
34 unsigned int keybits);
35 int esp_aes_crypt_ecb(
unsigned char *ctx,
int mode,
36 const unsigned char *input,
37 unsigned char *output);
42 memset(ctx, 0,
sizeof(ctx));
48 clean(ctx,
sizeof(ctx));
64 esp_aes_setkey(ctx, key, len * 8);
72 esp_aes_crypt_ecb(ctx, 1, input, output);
77 esp_aes_crypt_ecb(ctx, 0, input, output);
83 clean(ctx,
sizeof(ctx));
void encryptBlock(uint8_t *output, const uint8_t *input)
Encrypts a single block using this cipher.
void clear()
Clears all security-sensitive state from this block cipher.
virtual ~AESCommon()
Destroys this AES block cipher object after clearing sensitive information.
void decryptBlock(uint8_t *output, const uint8_t *input)
Decrypts a single block using this cipher.
size_t blockSize() const
Size of an AES block in bytes.
AESCommon()
Constructs an AES block cipher object.
virtual bool setKey(const uint8_t *key, size_t len)=0
Sets the key to use for future encryption and decryption operations.
virtual size_t keySize() const =0
Default size of the key for this block cipher, in bytes.