Encrypt and decrypt data with AES-256 in CTR mode using pure C.
More...
Go to the source code of this file.
|
void | aes_key_expand (const unsigned char *key, unsigned char *expandedKey) |
|
void | aes_transform (const unsigned char *expandedKey, unsigned char *data) |
|
int | aes_transform_ctr (const unsigned char *expandedKey, unsigned char *counter, const unsigned char *srcBuffer, int srcOffset, unsigned char *destBuffer, int destOffset, int count) |
|
Encrypt and decrypt data with AES-256 in CTR mode using pure C.
◆ aes_key_expand()
void aes_key_expand |
( |
const unsigned char * | key, |
|
|
unsigned char * | expandedKey ) |
Expand an AES-256 32-byte key to a 240-byte set of round keys.
- Parameters
-
key | The AES-256 (32-byte) key to expand. |
expandedKey | The expanded key (240-bytes). |
◆ aes_transform()
void aes_transform |
( |
const unsigned char * | expandedKey, |
|
|
unsigned char * | data ) |
Transform a 16-byte block using AES-256.
- Parameters
-
expandedKey | The expandedKey 240 bytes, see aes_key_expand() |
data | The data to transform. |
◆ aes_transform_ctr()
int aes_transform_ctr |
( |
const unsigned char * | expandedKey, |
|
|
unsigned char * | counter, |
|
|
const unsigned char * | srcBuffer, |
|
|
int | srcOffset, |
|
|
unsigned char * | destBuffer, |
|
|
int | destOffset, |
|
|
int | count ) |
Transform the data using AES-256 CTR mode.
- Parameters
-
expandedKey | The expanded AES-256 key (240 bytes), see aes_key_expand() |
counter | The counter. |
srcBuffer | The source array to transform. |
srcOffset | The source offset. |
destBuffer | The source array to transform. |
destOffset | The destination offset |
count | The number of bytes to transform |
- Returns
- The number of bytes transformed.