定义:
static const EVP_CIPHER FMC_ENG_evp_cipher=
{
NID_aes_128_cbc, /*nid*/
16, /*block_size*/
16, /*key_len*/
16, /*iv_len*/
EVP_CIPH_CBC_MODE, /*Various flags*/
FMC_ENG_evp_cipher_init, /*init*/
FMC_ENG_evp_cipher_do_cipher, /*do_cipher*/
FMC_ENG_evp_cipher_cleanup, /*cleanup*/
sizeof(AES_KEY) + 16, /*ctx_size*/
NULL, /*set_asn1_parameters*/
NULL, /*get_asn1_parameters*/
NULL, /*Miscellaneous operations*/
NULL /*app_data*/
};
首先解释:
NID_aes_128_cbc 为算法NID, 在bind engine时, 有调用:
ret = ENGINE_set_ciphers(e, FMC_EN