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 toEVP_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 beforeEVP_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 return0. 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 withEVP_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 withEVP_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 π
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
- alpine 3.23: openssl-doc 3.5.9-r0 Β· Apache-2.0
- alpine 3.24: openssl-doc 3.5.9-r0 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms