|
Lightweight Cryptography Primitives
|
AES block cipher. More...
#include "internal-util.h"Go to the source code of this file.
Data Structures | |
| struct | aes_key_schedule_t |
| Structure of the key schedule for AES. More... | |
Macros | |
| #define | AES_BLOCK_SIZE 16 |
| Size of the AES block in bytes. | |
| #define | AES128_KEY_SIZE 16 |
| Size of the AES-128 key in bytes. | |
| #define | AES192_KEY_SIZE 24 |
| Size of the AES-192 key in bytes. | |
| #define | AES256_KEY_SIZE 32 |
| Size of the AES-256 key in bytes. | |
| #define | AES_ROUND_KEYS 60 |
| Number of round keys for the AES key schedule. More... | |
Functions | |
| void | aes_128_init (aes_key_schedule_t *ks, const unsigned char *key) |
| Initializes the key schedule for AES-128. More... | |
| void | aes_192_init (aes_key_schedule_t *ks, const unsigned char *key) |
| Initializes the key schedule for AES-192. More... | |
| void | aes_256_init (aes_key_schedule_t *ks, const unsigned char *key) |
| Initializes the key schedule for AES-256. More... | |
| void | aes_ecb_encrypt (const aes_key_schedule_t *ks, unsigned char *output, const unsigned char *input) |
| Encrypts a 128-bit block with AES in ECB mode. More... | |
AES block cipher.
This version of AES is intended for performing comparisons with the other candidates in the Lightweight Cryptography Competition.
Note: This implementation is not constant cache. Internally it uses lookup tables for the AES S-box and MixColumns operation. This means that it has similar behaviour to other "fast" 32-bit software implementations of AES but is not suitable for use where memory cache attacks are a concern.
| #define AES_ROUND_KEYS 60 |
Number of round keys for the AES key schedule.
This is sized for AES-256. There will be some wasted space for AES-128 and AES-192.
| void aes_128_init | ( | aes_key_schedule_t * | ks, |
| const unsigned char * | key | ||
| ) |
Initializes the key schedule for AES-128.
| ks | Points to the key schedule to initialize. |
| key | Points to the key data. |
| void aes_192_init | ( | aes_key_schedule_t * | ks, |
| const unsigned char * | key | ||
| ) |
Initializes the key schedule for AES-192.
| ks | Points to the key schedule to initialize. |
| key | Points to the key data. |
| void aes_256_init | ( | aes_key_schedule_t * | ks, |
| const unsigned char * | key | ||
| ) |
Initializes the key schedule for AES-256.
| ks | Points to the key schedule to initialize. |
| key | Points to the key data. |
| void aes_ecb_encrypt | ( | const aes_key_schedule_t * | ks, |
| unsigned char * | output, | ||
| const unsigned char * | input | ||
| ) |
Encrypts a 128-bit block with AES in ECB mode.
| ks | Points to the AES key schedule. |
| output | Output buffer which must be at least 16 bytes in length. |
| input | Input buffer which must be at least 16 bytes in length. |
The input and output buffers can be the same buffer for in-place encryption.
1.8.6