26 #include "BlockCipher.h"
40 void encryptBlock(uint8_t *output,
const uint8_t *input);
41 void decryptBlock(uint8_t *output,
const uint8_t *input);
52 static void subBytesAndShiftRows(uint8_t *output,
const uint8_t *input);
53 static void inverseShiftRowsAndSubBytes(uint8_t *output,
const uint8_t *input);
54 static void mixColumn(uint8_t *output, uint8_t *input);
55 static void inverseMixColumn(uint8_t *output,
const uint8_t *input);
56 static void keyScheduleCore(uint8_t *output,
const uint8_t *input, uint8_t iteration);
57 static void applySbox(uint8_t *output,
const uint8_t *input);
74 bool setKey(
const uint8_t *key,
size_t len);
88 bool setKey(
const uint8_t *key,
size_t len);
102 bool setKey(
const uint8_t *key,
size_t len);
117 bool setKey(
const uint8_t *key,
size_t len);
119 void encryptBlock(uint8_t *output,
const uint8_t *input);
120 void decryptBlock(uint8_t *output,
const uint8_t *input);
125 uint8_t schedule[32];
134 bool setKey(
const uint8_t *key,
size_t len);
136 void decryptBlock(uint8_t *output,
const uint8_t *input);
153 bool setKey(
const uint8_t *key,
size_t len);
155 void encryptBlock(uint8_t *output,
const uint8_t *input);
156 void decryptBlock(uint8_t *output,
const uint8_t *input);
161 uint8_t schedule[16];
170 bool setKey(
const uint8_t *key,
size_t len);
172 void decryptBlock(uint8_t *output,
const uint8_t *input);
void clear()
Clears all security-sensitive state from this block cipher.
size_t keySize() const
Size of a 256-bit AES key in bytes.
AES block cipher with 256-bit keys and tiny memory usage.
size_t keySize() const
Size of a 128-bit AES key in bytes.
void clear()
Clears all security-sensitive state from this block cipher.
void decryptBlock(uint8_t *output, const uint8_t *input)
Decrypts a single block using this cipher.
AES block cipher with 256-bit keys.
AES block cipher with 128-bit keys and tiny memory usage.
Abstract base class for block ciphers.
void decryptBlock(uint8_t *output, const uint8_t *input)
Decrypts a single block using this cipher.
AESSmall256()
Constructs an AES 256-bit block cipher with no initial key.
AESCommon()
Constructs an AES block cipher object.
void encryptBlock(uint8_t *output, const uint8_t *input)
Encrypts a single block using this cipher.
size_t keySize() const
Size of a 128-bit AES key in bytes.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
size_t blockSize() const
Size of an AES block in bytes.
void decryptBlock(uint8_t *output, const uint8_t *input)
Decrypts 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 clear()
Clears all security-sensitive state from this block cipher.
void decryptBlock(uint8_t *output, const uint8_t *input)
Decrypts a single block using this cipher.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
void encryptBlock(uint8_t *output, const uint8_t *input)
Encrypts a single block using this cipher.
size_t keySize() const
Size of a 192-bit AES key in bytes.
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.
AESTiny128()
Constructs an AES 128-bit block cipher with no initial key.
void encryptBlock(uint8_t *output, const uint8_t *input)
Encrypts a single block using this cipher.
AES256()
Constructs an AES 256-bit block cipher with no initial key.
Abstract base class for AES block ciphers.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
AES block cipher with 128-bit keys.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
void clear()
Clears all security-sensitive state from this block cipher.
AESTiny256()
Constructs an AES 256-bit block cipher with no initial key.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
size_t keySize() const
Size of a 256-bit AES key in bytes.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
AES128()
Constructs an AES 128-bit block cipher with no initial key.
AES block cipher with 128-bit keys and reduced memory usage.
size_t blockSize() const
Size of an AES block in bytes.
AES block cipher with 192-bit keys.
AES block cipher with 256-bit keys and reduced memory usage.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
AES192()
Constructs an AES 192-bit block cipher with no initial key.
AESSmall128()
Constructs an AES 128-bit block cipher with no initial key.