![]() |
ndn-lite
|
– Interface to an AES-128 implementation. More...
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | tc_aes_key_sched_struct |
Macros | |
#define | Nb (4) /* number of columns (32-bit words) comprising the state */ |
#define | Nk (4) /* number of 32-bit words comprising the key */ |
#define | Nr (10) /* number of rounds */ |
#define | TC_AES_BLOCK_SIZE (Nb*Nk) |
#define | TC_AES_KEY_SIZE (Nb*Nk) |
Typedefs | |
typedef struct tc_aes_key_sched_struct * | TCAesKeySched_t |
Functions | |
int | tc_aes128_set_encrypt_key (TCAesKeySched_t s, const uint8_t *k) |
Set AES-128 encryption key Uses key k to initialize s. More... | |
int | tc_aes_encrypt (uint8_t *out, const uint8_t *in, const TCAesKeySched_t s) |
AES-128 Encryption procedure Encrypts contents of in buffer into out buffer under key; schedule s. More... | |
int | tc_aes128_set_decrypt_key (TCAesKeySched_t s, const uint8_t *k) |
Set the AES-128 decryption key Uses key k to initialize s. More... | |
int | tc_aes_decrypt (uint8_t *out, const uint8_t *in, const TCAesKeySched_t s) |
AES-128 Encryption procedure Decrypts in buffer into out buffer under key schedule s. More... | |
– Interface to an AES-128 implementation.
Overview: AES-128 is a NIST approved block cipher specified in FIPS 197. Block ciphers are deterministic algorithms that perform a transformation specified by a symmetric key in fixed- length data sets, also called blocks.
Security: AES-128 provides approximately 128 bits of security.
Usage: 1) call tc_aes128_set_encrypt/decrypt_key to set the key.
2) call tc_aes_encrypt/decrypt to process the data.
#define Nb (4) /* number of columns (32-bit words) comprising the state */ |
#define Nk (4) /* number of 32-bit words comprising the key */ |
#define Nr (10) /* number of rounds */ |
typedef struct tc_aes_key_sched_struct * TCAesKeySched_t |
int tc_aes128_set_decrypt_key | ( | TCAesKeySched_t | s, |
const uint8_t * | k | ||
) |
Set the AES-128 decryption key Uses key k to initialize s.
s | IN/OUT – initialized struct tc_aes_key_sched_struct |
k | IN – points to the AES key |
int tc_aes128_set_encrypt_key | ( | TCAesKeySched_t | s, |
const uint8_t * | k | ||
) |
Set AES-128 encryption key Uses key k to initialize s.
s | IN/OUT – initialized struct tc_aes_key_sched_struct |
k | IN – points to the AES key |
int tc_aes_decrypt | ( | uint8_t * | out, |
const uint8_t * | in, | ||
const TCAesKeySched_t | s | ||
) |
AES-128 Encryption procedure Decrypts in buffer into out buffer under key schedule s.
out | IN/OUT – buffer to receive ciphertext block |
in | IN – a plaintext block to encrypt |
s | IN – initialized AES key schedule |
int tc_aes_encrypt | ( | uint8_t * | out, |
const uint8_t * | in, | ||
const TCAesKeySched_t | s | ||
) |
AES-128 Encryption procedure Encrypts contents of in buffer into out buffer under key; schedule s.
out | IN/OUT – buffer to receive ciphertext block |
in | IN – a plaintext block to encrypt |
s | IN – initialized AES key schedule |