Compute AES CMAC using OpenSSL/libcrypto
When I googled on how to perform the AES CMAC calculation using OpenSSL/libcrypto I couldn’t find any code example. I was no even sure that there was support for it of libcrypto so I downloaded the OpenSSL sources and dig into them until I found crypto/cmac/cmac.c. From there it was obvious that there is support for CMAC and that it follow the *{Init,Update,Final} pattern found in EVP api. So I give it I try and I’m sharing the basic source code here for later reference: ...