A structure to perform AES encryption. The size of the structure is 548 bytes.
More...
#include "SuperpoweredAES.h"
|
bool | cryptCBC (bool encrypt, unsigned char iv[16], int inputLengthBytes, const unsigned char *input, unsigned char *output) |
| Encrypts with Cipher Block Chaining (CBC) block cipher mode. More...
|
|
int | cryptCFB128 (bool encrypt, int ivOffset, unsigned char iv[16], int inputLengthBytes, const unsigned char *input, unsigned char *output) |
| Encrypts with Cipher Feedback (CFB) block cipher mode (8 bit feedback). More...
|
|
void | cryptCFB8 (bool encrypt, unsigned char iv[16], int inputLengthBytes, const unsigned char *input, unsigned char *output) |
| Encrypts with Cipher Feedback (CFB)) block cipher mode (128 bit feedback). More...
|
|
int | cryptCTR (unsigned char nonceCounter[16], int streamBlockOffset, unsigned char streamBlock[16], int inputLengthBytes, const unsigned char *input, unsigned char *output) |
| Encrypts with Counter (CTR) block cipher mode. More...
|
|
void | cryptECB (bool encrypt, const unsigned char input[16], unsigned char output[16]) |
| Encrypts with Electronic Codeblock (ECB) block cipher mode. More...
|
|
bool | setKey (const unsigned char *key, unsigned int keySizeBits) |
| Set the key. More...
|
|
A structure to perform AES encryption. The size of the structure is 548 bytes.
◆ cryptCBC()
bool Superpowered::AES::cryptCBC |
( |
bool |
encrypt, |
|
|
unsigned char |
iv[16], |
|
|
int |
inputLengthBytes, |
|
|
const unsigned char * |
input, |
|
|
unsigned char * |
output |
|
) |
| |
Encrypts with Cipher Block Chaining (CBC) block cipher mode.
- Parameters
-
encrypt | True to encrypt, false to decrypt. |
iv | Initialization vector (16 bytes). |
inputLengthBytes | Number of bytes in input. Must be a multiple of 16. |
input | Input data. |
output | Output data. Must be at least inputLengthBytes big. |
- Returns
- True on success, false if inputLengthBytes is not a multiple of 16.
◆ cryptCFB128()
int Superpowered::AES::cryptCFB128 |
( |
bool |
encrypt, |
|
|
int |
ivOffset, |
|
|
unsigned char |
iv[16], |
|
|
int |
inputLengthBytes, |
|
|
const unsigned char * |
input, |
|
|
unsigned char * |
output |
|
) |
| |
Encrypts with Cipher Feedback (CFB) block cipher mode (8 bit feedback).
- Parameters
-
encrypt | True to encrypt, false to decrypt. |
ivOffset | Initialization vector offset. |
iv | Initialization vector (16 bytes). |
inputLengthBytes | Number of bytes in input. |
input | Input data. |
output | Output data. Must be at least inputLengthBytes big. |
- Returns
- The updated, new value of ivOffset.
◆ cryptCFB8()
void Superpowered::AES::cryptCFB8 |
( |
bool |
encrypt, |
|
|
unsigned char |
iv[16], |
|
|
int |
inputLengthBytes, |
|
|
const unsigned char * |
input, |
|
|
unsigned char * |
output |
|
) |
| |
Encrypts with Cipher Feedback (CFB)) block cipher mode (128 bit feedback).
- Parameters
-
encrypt | True to encrypt, false to decrypt. |
iv | Initialization vector (16 bytes). |
inputLengthBytes | Number of bytes in input. |
input | Input data. |
output | Output data. Must be at least inputLengthBytes big. |
◆ cryptCTR()
int Superpowered::AES::cryptCTR |
( |
unsigned char |
nonceCounter[16], |
|
|
int |
streamBlockOffset, |
|
|
unsigned char |
streamBlock[16], |
|
|
int |
inputLengthBytes, |
|
|
const unsigned char * |
input, |
|
|
unsigned char * |
output |
|
) |
| |
Encrypts with Counter (CTR) block cipher mode.
- Parameters
-
nonceCounter | Pseudo-ramdom number, high enough to not repeat for a long time. |
streamBlockOffset | Stream block offset (start with 0, will be updated). |
streamBlock | Stream block. |
inputLengthBytes | Number of bytes in input. |
input | Input data. |
output | Output data. Must be at least inputLengthBytes big. |
- Returns
- The updated, new value of streamBlockOffset.
◆ cryptECB()
void Superpowered::AES::cryptECB |
( |
bool |
encrypt, |
|
|
const unsigned char |
input[16], |
|
|
unsigned char |
output[16] |
|
) |
| |
Encrypts with Electronic Codeblock (ECB) block cipher mode.
- Parameters
-
encrypt | True to encrypt, false to decrypt. |
input | Input data (16 bytes). |
output | Output data (16 bytes). |
◆ setKey()
bool Superpowered::AES::setKey |
( |
const unsigned char * |
key, |
|
|
unsigned int |
keySizeBits |
|
) |
| |
Set the key.
- Parameters
-
key | The key. |
keySizeBits | The size of the key in bits. Valid values are: 128, 192, 256. |
- Returns
- True on success, false on error (invalid value in keySizeBits).
◆ dc
unsigned int Superpowered::AES::dc[68] |
◆ ec
unsigned int Superpowered::AES::ec[68] |
◆ numberOfRounds
int Superpowered::AES::numberOfRounds |
The documentation for this struct was generated from the following file:
- latest/Superpowered/SuperpoweredAES.h