[openssl-users] AES-CMAC digest with EVP

Daniel Andrade daniel.andrade at tecnico.ulisboa.pt
Wed Aug 30 12:21:20 UTC 2017


Hello,

I have two buffers, one with a key and one with some data. The objective 
is to calculate the AES-CMAC of the data with this key. I managed to 
compute the AES-CMAC using type `EVP_aes_128_cbc()` with the low-level 
interface:

1. CMAC_CTX *ctx = CMAC_CTX_new()
2. CMAC_Init
3. CMAC_Update
4. CMAC_Final
5. CMAC_CTX_free

Can this be done with the high-level EVP interface?

The EVP_DigestSign* set of functions expects a type EVP_MD, but 
EVP_aes_128_cbc() is of type EVP_CIPHER.

Daniel


More information about the openssl-users mailing list