Go to the source code of this file.
Data Structures | |
struct | aes_context |
AES context structure. More... | |
Defines | |
#define | AES_ENCRYPT 1 |
#define | AES_DECRYPT 0 |
Functions | |
void | aes_setkey_enc (aes_context *ctx, unsigned char *key, int keysize) |
AES key schedule (encryption). | |
void | aes_setkey_dec (aes_context *ctx, unsigned char *key, int keysize) |
AES key schedule (decryption). | |
void | aes_crypt_ecb (aes_context *ctx, int mode, unsigned char input[16], unsigned char output[16]) |
AES-ECB block encryption/decryption. | |
void | aes_crypt_cbc (aes_context *ctx, int mode, int length, unsigned char iv[16], unsigned char *input, unsigned char *output) |
AES-CBC buffer encryption/decryption. | |
void | aes_crypt_cfb (aes_context *ctx, int mode, int length, int *iv_off, unsigned char iv[16], unsigned char *input, unsigned char *output) |
AES-CFB buffer encryption/decryption. | |
int | aes_self_test (int verbose) |
Checkup routine. |
Definition in file aes.h.
#define AES_DECRYPT 0 |
Definition at line 8 of file aes.h.
Referenced by aes_crypt_cbc(), aes_crypt_cfb(), aes_crypt_ecb(), aes_en_de(), aes_self_test(), main(), and ssl_decrypt_buf().
#define AES_ENCRYPT 1 |
Definition at line 7 of file aes.h.
Referenced by aes_crypt_cfb(), aes_en_de(), main(), and ssl_encrypt_buf().
void aes_crypt_cbc | ( | aes_context * | ctx, | |
int | mode, | |||
int | length, | |||
unsigned char | iv[16], | |||
unsigned char * | input, | |||
unsigned char * | output | |||
) |
AES-CBC buffer encryption/decryption.
ctx | AES context | |
mode | AES_ENCRYPT or AES_DECRYPT | |
length | length of the input data | |
iv | initialization vector (updated after use) | |
input | buffer holding the input data | |
output | buffer holding the output data |
Definition at line 732 of file aes.c.
References aes_crypt_ecb(), and AES_DECRYPT.
Referenced by aes_self_test(), main(), ssl_decrypt_buf(), and ssl_encrypt_buf().
void aes_crypt_cfb | ( | aes_context * | ctx, | |
int | mode, | |||
int | length, | |||
int * | iv_off, | |||
unsigned char | iv[16], | |||
unsigned char * | input, | |||
unsigned char * | output | |||
) |
AES-CFB buffer encryption/decryption.
ctx | AES context | |
mode | AES_ENCRYPT or AES_DECRYPT | |
length | length of the input data | |
iv_off | offset in IV (updated after use) | |
iv | initialization vector (updated after use) | |
input | buffer holding the input data | |
output | buffer holding the output data |
Definition at line 787 of file aes.c.
References aes_crypt_ecb(), AES_DECRYPT, and AES_ENCRYPT.
Referenced by aes_self_test().
void aes_crypt_ecb | ( | aes_context * | ctx, | |
int | mode, | |||
unsigned char | input[16], | |||
unsigned char | output[16] | |||
) |
AES-ECB block encryption/decryption.
ctx | AES context | |
mode | AES_ENCRYPT or AES_DECRYPT | |
input | 16-byte input block | |
output | 16-byte output block |
Definition at line 639 of file aes.c.
References AES_DECRYPT, AES_FROUND, AES_RROUND, FSb, GET_ULONG_LE, aes_context::nr, PUT_ULONG_LE, aes_context::rk, and RSb.
Referenced by aes_crypt_cbc(), aes_crypt_cfb(), aes_en_de(), aes_self_test(), and main().
Checkup routine.
Definition at line 902 of file aes.c.
References aes_crypt_cbc(), aes_crypt_cfb(), aes_crypt_ecb(), AES_DECRYPT, aes_setkey_dec(), aes_setkey_enc(), aes_test_cbc_dec, aes_test_cbc_enc, aes_test_cfb_dec, aes_test_cfb_enc, aes_test_ecb_dec, aes_test_ecb_enc, buf, and prv.
Referenced by main().
void aes_setkey_dec | ( | aes_context * | ctx, | |
unsigned char * | key, | |||
int | keysize | |||
) |
AES key schedule (decryption).
ctx | AES context to be initialized | |
key | decryption key | |
keysize | must be 128, 192 or 256 |
Definition at line 542 of file aes.c.
References aes_setkey_enc(), aes_context::buf, FSb, aes_context::nr, aes_context::rk, RT0, RT1, RT2, and RT3.
Referenced by aes_en_de(), aes_self_test(), main(), and ssl_derive_keys().
void aes_setkey_enc | ( | aes_context * | ctx, | |
unsigned char * | key, | |||
int | keysize | |||
) |
AES key schedule (encryption).
ctx | AES context to be initialized | |
key | encryption key | |
keysize | must be 128, 192 or 256 |
Definition at line 439 of file aes.c.
References aes_gen_tables(), aes_init_done, aes_context::buf, FSb, GET_ULONG_LE, aes_context::nr, RCON, and aes_context::rk.
Referenced by aes_en_de(), aes_self_test(), aes_setkey_dec(), main(), and ssl_derive_keys().