40 #define AES_ENC_PREKEYED
43 #define AES_DEC_PREKEYED
46 #define AES_ENC_128_OTFK
49 #define AES_DEC_128_OTFK
52 #define AES_ENC_256_OTFK
55 #define AES_DEC_256_OTFK
60 #define N_BLOCK (N_ROW * N_COL)
61 #define N_MAX_ROUNDS 14
87 #if defined(AES_ENC_PREKEYED) || defined(AES_DEC_PREKEYED)
94 #if defined(AES_ENC_PREKEYED)
97 unsigned char out[N_BLOCK],
107 #if defined(AES_DEC_PREKEYED)
110 unsigned char out[N_BLOCK],
140 #if defined(AES_ENC_128_OTFK)
141 void aes_encrypt_128(
const unsigned char in[
N_BLOCK],
142 unsigned char out[N_BLOCK],
143 const unsigned char key[N_BLOCK],
147 #if defined(AES_DEC_128_OTFK)
148 void aes_decrypt_128(
const unsigned char in[
N_BLOCK],
149 unsigned char out[N_BLOCK],
150 const unsigned char key[N_BLOCK],
151 unsigned char o_key[N_BLOCK]);
154 #if defined(AES_ENC_256_OTFK)
155 void aes_encrypt_256(
const unsigned char in[
N_BLOCK],
156 unsigned char out[N_BLOCK],
157 const unsigned char key[2 * N_BLOCK],
158 unsigned char o_key[2 * N_BLOCK]);
161 #if defined(AES_DEC_256_OTFK)
162 void aes_decrypt_256(
const unsigned char in[
N_BLOCK],
163 unsigned char out[N_BLOCK],
164 const unsigned char key[2 * N_BLOCK],
165 unsigned char o_key[2 * N_BLOCK]);
return_type aes_decrypt(const unsigned char in[N_BLOCK], unsigned char out[N_BLOCK], const aes_context ctx[1])
return_type aes_set_key(const unsigned char key[], length_type keylen, aes_context ctx[1])
return_type aes_cbc_decrypt(const unsigned char *in, unsigned char *out, int n_block, unsigned char iv[N_BLOCK], const aes_context ctx[1])
return_type aes_cbc_encrypt(const unsigned char *in, unsigned char *out, int n_block, unsigned char iv[N_BLOCK], const aes_context ctx[1])
return_type aes_encrypt(const unsigned char in[N_BLOCK], unsigned char out[N_BLOCK], const aes_context ctx[1])