70
70
IMPLEMENT_BLOCK_CIPHER(aes_128, ks, AES, EVP_AES_KEY,
71
71
NID_aes_128, 16, 16, 16, 128,
72
EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_DEFAULT_ASN1,
74
NULL, NULL, NULL, NULL)
72
0, aes_init_key, NULL,
73
EVP_CIPHER_set_asn1_iv,
74
EVP_CIPHER_get_asn1_iv,
75
76
IMPLEMENT_BLOCK_CIPHER(aes_192, ks, AES, EVP_AES_KEY,
76
77
NID_aes_192, 16, 24, 16, 128,
77
EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_DEFAULT_ASN1,
79
NULL, NULL, NULL, NULL)
78
0, aes_init_key, NULL,
79
EVP_CIPHER_set_asn1_iv,
80
EVP_CIPHER_get_asn1_iv,
80
82
IMPLEMENT_BLOCK_CIPHER(aes_256, ks, AES, EVP_AES_KEY,
81
83
NID_aes_256, 16, 32, 16, 128,
82
EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_DEFAULT_ASN1,
84
NULL, NULL, NULL, NULL)
86
#define IMPLEMENT_AES_CFBR(ksize,cbits,flags) IMPLEMENT_CFBR(aes,AES,EVP_AES_KEY,ks,ksize,cbits,16,flags)
88
IMPLEMENT_AES_CFBR(128,1,EVP_CIPH_FLAG_FIPS)
89
IMPLEMENT_AES_CFBR(192,1,EVP_CIPH_FLAG_FIPS)
90
IMPLEMENT_AES_CFBR(256,1,EVP_CIPH_FLAG_FIPS)
92
IMPLEMENT_AES_CFBR(128,8,EVP_CIPH_FLAG_FIPS)
93
IMPLEMENT_AES_CFBR(192,8,EVP_CIPH_FLAG_FIPS)
94
IMPLEMENT_AES_CFBR(256,8,EVP_CIPH_FLAG_FIPS)
84
0, aes_init_key, NULL,
85
EVP_CIPHER_set_asn1_iv,
86
EVP_CIPHER_get_asn1_iv,
89
#define IMPLEMENT_AES_CFBR(ksize,cbits) IMPLEMENT_CFBR(aes,AES,EVP_AES_KEY,ks,ksize,cbits,16)
91
IMPLEMENT_AES_CFBR(128,1)
92
IMPLEMENT_AES_CFBR(192,1)
93
IMPLEMENT_AES_CFBR(256,1)
95
IMPLEMENT_AES_CFBR(128,8)
96
IMPLEMENT_AES_CFBR(192,8)
97
IMPLEMENT_AES_CFBR(256,8)
96
99
static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
97
100
const unsigned char *iv, int enc)