EVP_MAC-CMAC(7ossl)

πŸ’… NAME πŸ’…

ok so this is the EVP_MAC-CMAC page β€” it lives in the 7ossl manual section btw β€” and it's literally all about the CMAC EVP_MAC implementation. one (1) whole MAC, iconic behavior only ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

bestie. it's support for computing CMAC MACs through the EVP_MAC API. that's the whole vibe.

and lowkey the way it works? this implementation uses EVP_CIPHER functions to get access to the underlying cipher. that's the plug, iykyk πŸ’…

πŸŽ€ Identity πŸŽ€

so this implementation is identified with this name and these properties, and you use them with EVP_MAC_fetch():

"CMAC", "provider=default" or "provider=fips"

that's the name tag. no cap 🫢

🌸 Supported parameters 🌸

the general description of these parameters is in "PARAMETERS" in EVP_MAC(3) β€” go read that if you want the full lore.

The following parameter can be set with EVP_MAC_CTX_set_params(): ⬇️

  • "key" (OSSL_MAC_PARAM_KEY) <octet string> β€” sets the MAC key. and setting this parameter is identical to passing a key to EVP_MAC_init(3). same thing, different font πŸ’–
  • "cipher" (OSSL_MAC_PARAM_CIPHER) <UTF8 string> β€” sets the name of the underlying cipher to be used. the mode of the cipher must be CBC though, like that's non-negotiable, periodt.
  • "properties" (OSSL_MAC_PARAM_PROPERTIES) <UTF8 string> β€” sets the properties to be queried when trying to fetch the underlying cipher. and this must be given together with the cipher naming parameter to be considered valid. they're a package deal, they don't go anywhere without each other 😭
  • "encrypt-check" (OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK) <integer> β€” this option is used by the OpenSSL FIPS provider. if required, this parameter should be set before EVP_MAC_init().

the default value of 1 causes an error when an unapproved Triple-DES encryption operation is triggered. setting this to 0 will ignore the error and set the approved "fips-indicator" to 0. and heads up:

this option breaks FIPS compliance if it causes the approved "fips-indicator" to return 0. so like… careful, bestie πŸ’€

The following parameters can be retrieved with EVP_MAC_CTX_get_params(): ⬆️

  • "size" (OSSL_MAC_PARAM_SIZE) <unsigned integer> β€” so the "size" parameter can also be retrieved with EVP_MAC_CTX_get_mac_size(). (yes the manpage says "with with", we're keeping it, we don't gatekeep typos here πŸ™ˆ) and the length of the "size" parameter is equal to that of an unsigned int.
  • "block-size" (OSSL_MAC_PARAM_BLOCK_SIZE) <unsigned integer> β€” gets the MAC block size. the "block-size" parameter can also be retrieved with EVP_MAC_CTX_get_block_size() ✨
  • "fips-indicator" (OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR) <integer> β€” this option is used by the OpenSSL FIPS provider.

it's a getter that returns 1 if the operation is FIPS approved, or 0 otherwise. this may be used after calling EVP_MAC_final(). also it may return 0 if the "encrypt-check" option is set to 0. so the two are linked, bestie, they're in a situationship πŸŒ€


⭐ SEE ALSO ⭐

EVP_MAC_CTX_get_params(3), EVP_MAC_CTX_set_params(3), "PARAMETERS" in EVP_MAC(3), OSSL_PARAM(3)

go read the whole friend group πŸ’œ

Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.

licensed under the Apache License 2.0 (the "License"). you may not use this file except in compliance with the License. you can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


ok that's the whole page, mwah πŸ“ this was version 3.5.9, dated 2026-09-29 β€” slay, go forth and MAC responsibly πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from