1b077aed3SPierre Pronchery=pod 2b077aed3SPierre Pronchery 3b077aed3SPierre Pronchery=head1 NAME 4b077aed3SPierre Pronchery 5b077aed3SPierre ProncheryEVP_MAC-HMAC - The HMAC EVP_MAC implementation 6b077aed3SPierre Pronchery 7b077aed3SPierre Pronchery=head1 DESCRIPTION 8b077aed3SPierre Pronchery 9b077aed3SPierre ProncherySupport for computing HMAC MACs through the B<EVP_MAC> API. 10b077aed3SPierre Pronchery 11b077aed3SPierre ProncheryThis implementation uses EVP_MD functions to get access to the underlying 12b077aed3SPierre Proncherydigest. 13b077aed3SPierre Pronchery 14b077aed3SPierre Pronchery=head2 Identity 15b077aed3SPierre Pronchery 16b077aed3SPierre ProncheryThis implementation is identified with this name and properties, to be 17b077aed3SPierre Proncheryused with EVP_MAC_fetch(): 18b077aed3SPierre Pronchery 19b077aed3SPierre Pronchery=over 4 20b077aed3SPierre Pronchery 21b077aed3SPierre Pronchery=item "HMAC", "provider=default" or "provider=fips" 22b077aed3SPierre Pronchery 23b077aed3SPierre Pronchery=back 24b077aed3SPierre Pronchery 25b077aed3SPierre Pronchery=head2 Supported parameters 26b077aed3SPierre Pronchery 27b077aed3SPierre ProncheryThe general description of these parameters can be found in 28b077aed3SPierre ProncheryL<EVP_MAC(3)/PARAMETERS>. 29b077aed3SPierre Pronchery 30b077aed3SPierre ProncheryThe following parameter can be set with EVP_MAC_CTX_set_params(): 31b077aed3SPierre Pronchery 32b077aed3SPierre Pronchery=over 4 33b077aed3SPierre Pronchery 34b077aed3SPierre Pronchery=item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string> 35b077aed3SPierre Pronchery 36b077aed3SPierre ProncherySets the MAC key. 37b077aed3SPierre ProncherySetting this parameter is identical to passing a I<key> to L<EVP_MAC_init(3)>. 38b077aed3SPierre Pronchery 39b077aed3SPierre Pronchery=item "digest" (B<OSSL_MAC_PARAM_DIGEST>) <UTF8 string> 40b077aed3SPierre Pronchery 41b077aed3SPierre ProncherySets the name of the underlying digest to be used. 42b077aed3SPierre Pronchery 43b077aed3SPierre Pronchery=item "properties" (B<OSSL_MAC_PARAM_PROPERTIES>) <UTF8 string> 44b077aed3SPierre Pronchery 45b077aed3SPierre ProncherySets the properties to be queried when trying to fetch the underlying digest. 46b077aed3SPierre ProncheryThis must be given together with the digest naming parameter ("digest", or 47b077aed3SPierre ProncheryB<OSSL_MAC_PARAM_DIGEST>) to be considered valid. 48b077aed3SPierre Pronchery 49b077aed3SPierre Pronchery=item "digest-noinit" (B<OSSL_MAC_PARAM_DIGEST_NOINIT>) <integer> 50b077aed3SPierre Pronchery 51b077aed3SPierre ProncheryA flag to set the MAC digest to not initialise the implementation 52b077aed3SPierre Proncheryspecific data. 53b077aed3SPierre ProncheryThe value 0 or 1 is expected. 54b077aed3SPierre Pronchery 55b077aed3SPierre Pronchery=item "digest-oneshot" (B<OSSL_MAC_PARAM_DIGEST_ONESHOT>) <integer> 56b077aed3SPierre Pronchery 57b077aed3SPierre ProncheryA flag to set the MAC digest to be a one-shot operation. 58b077aed3SPierre ProncheryThe value 0 or 1 is expected. 59b077aed3SPierre Pronchery 60b077aed3SPierre Pronchery=item "tls-data-size" (B<OSSL_MAC_PARAM_TLS_DATA_SIZE>) <unsigned integer> 61b077aed3SPierre Pronchery 62b077aed3SPierre Pronchery=back 63b077aed3SPierre Pronchery 64b077aed3SPierre Pronchery=for comment The "flags" parameter is passed directly to HMAC_CTX_set_flags(). 65b077aed3SPierre Pronchery 66b077aed3SPierre ProncheryThe following parameter can be retrieved with EVP_MAC_CTX_get_params(): 67b077aed3SPierre Pronchery 68b077aed3SPierre Pronchery=over 4 69b077aed3SPierre Pronchery 70b077aed3SPierre Pronchery=item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer> 71b077aed3SPierre Pronchery 72b077aed3SPierre ProncheryThe "size" parameter can also be retrieved with EVP_MAC_CTX_get_mac_size(). 73b077aed3SPierre ProncheryThe length of the "size" parameter is equal to that of an B<unsigned int>. 74b077aed3SPierre Pronchery 75b077aed3SPierre Pronchery=back 76b077aed3SPierre Pronchery 77b077aed3SPierre Pronchery=over 4 78b077aed3SPierre Pronchery 79*e0c4386eSCy Schubert=item "block-size" (B<OSSL_MAC_PARAM_BLOCK_SIZE>) <unsigned integer> 80b077aed3SPierre Pronchery 81b077aed3SPierre ProncheryGets the MAC block size. The "block-size" parameter can also be retrieved with 82b077aed3SPierre ProncheryEVP_MAC_CTX_get_block_size(). 83b077aed3SPierre Pronchery 84b077aed3SPierre Pronchery=back 85b077aed3SPierre Pronchery 86b077aed3SPierre Pronchery=head1 SEE ALSO 87b077aed3SPierre Pronchery 88b077aed3SPierre ProncheryL<EVP_MAC_CTX_get_params(3)>, L<EVP_MAC_CTX_set_params(3)>, 89b077aed3SPierre ProncheryL<EVP_MAC(3)/PARAMETERS>, L<OSSL_PARAM(3)>, L<HMAC(3)> 90b077aed3SPierre Pronchery 91b077aed3SPierre Pronchery=head1 COPYRIGHT 92b077aed3SPierre Pronchery 93b077aed3SPierre ProncheryCopyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved. 94b077aed3SPierre Pronchery 95b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 96b077aed3SPierre Proncherythis file except in compliance with the License. You can obtain a copy 97b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at 98b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>. 99b077aed3SPierre Pronchery 100b077aed3SPierre Pronchery=cut 101