1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos EVP_MD-SHAKE, EVP_MD-KECCAK-KMAC 6 1.1 christos - The SHAKE / KECCAK family EVP_MD implementations 7 1.1 christos 8 1.1 christos =head1 DESCRIPTION 9 1.1 christos 10 1.1 christos Support for computing SHAKE or KECCAK-KMAC digests through the 11 1.1 christos B<EVP_MD> API. 12 1.1 christos 13 1.1 christos KECCAK-KMAC is an Extendable Output Function (XOF), with a definition 14 1.1 christos similar to SHAKE, used by the KMAC EVP_MAC implementation (see 15 1.1 christos L<EVP_MAC-KMAC(7)>). 16 1.1 christos 17 1.1 christos =head2 Identities 18 1.1 christos 19 1.1 christos This implementation is available in the FIPS provider as well as the default 20 1.1 christos provider, and includes the following varieties: 21 1.1 christos 22 1.1 christos =over 4 23 1.1 christos 24 1.1 christos =item KECCAK-KMAC-128 25 1.1 christos 26 1.1 christos Known names are "KECCAK-KMAC-128" and "KECCAK-KMAC128". This is used 27 1.1 christos by L<EVP_MAC-KMAC128(7)>. Using the notation from NIST FIPS 202 28 1.1 christos (Section 6.2), we have S<KECCAK-KMAC-128(M, d)> = S<KECCAK[256](M || 00, d)> 29 1.1 christos (see the description of KMAC128 in Appendix A of NIST SP 800-185). 30 1.1 christos 31 1.1 christos =item KECCAK-KMAC-256 32 1.1 christos 33 1.1 christos Known names are "KECCAK-KMAC-256" and "KECCAK-KMAC256". This is used 34 1.1 christos by L<EVP_MAC-KMAC256(7)>. Using the notation from NIST FIPS 202 35 1.1 christos (Section 6.2), we have S<KECCAK-KMAC-256(M, d)> = S<KECCAK[512](M || 00, d)> 36 1.1 christos (see the description of KMAC256 in Appendix A of NIST SP 800-185). 37 1.1 christos 38 1.1 christos =item SHAKE-128 39 1.1 christos 40 1.1 christos Known names are "SHAKE-128" and "SHAKE128". 41 1.1 christos 42 1.1 christos =item SHAKE-256 43 1.1 christos 44 1.1 christos Known names are "SHAKE-256" and "SHAKE256". 45 1.1 christos 46 1.1 christos =back 47 1.1 christos 48 1.1 christos =head2 Parameters 49 1.1 christos 50 1.1 christos This implementation supports the following L<OSSL_PARAM(3)> entries: 51 1.1 christos 52 1.1 christos =over 4 53 1.1 christos 54 1.1 christos =item "xoflen" (B<OSSL_DIGEST_PARAM_XOFLEN>) <unsigned integer> 55 1.1 christos 56 1.1 christos Sets or Gets the digest length for extendable output functions. 57 1.1 christos The length of the "xoflen" parameter should not exceed that of a B<size_t>. 58 1.1 christos 59 1.1 christos The SHAKE-128 and SHAKE-256 implementations do not have any default digest 60 1.1 christos length. 61 1.1 christos 62 1.1 christos This parameter must be set before calling either EVP_DigestFinal_ex() or 63 1.1 christos EVP_DigestFinal(), since these functions were not designed to handle variable 64 1.1 christos length output. It is recommended to either use EVP_DigestSqueeze() or 65 1.1 christos EVP_DigestFinalXOF() instead. 66 1.1 christos 67 1.1 christos =item "size" (B<OSSL_DIGEST_PARAM_SIZE>) <unsigned integer> 68 1.1 christos 69 1.1 christos An alias of "xoflen". 70 1.1 christos 71 1.1 christos =back 72 1.1 christos 73 1.1 christos See L<EVP_DigestInit(3)/PARAMETERS> for further information related to parameters 74 1.1 christos 75 1.1 christos =head1 NOTES 76 1.1 christos 77 1.1 christos For SHAKE-128, to ensure the maximum security strength of 128 bits, the output 78 1.1 christos length passed to EVP_DigestFinalXOF() should be at least 32. 79 1.1 christos 80 1.1 christos For SHAKE-256, to ensure the maximum security strength of 256 bits, the output 81 1.1 christos length passed to EVP_DigestFinalXOF() should be at least 64. 82 1.1 christos 83 1.1 christos =head1 SEE ALSO 84 1.1 christos 85 1.1 christos L<EVP_MD_CTX_set_params(3)>, L<provider-digest(7)>, L<OSSL_PROVIDER-default(7)> 86 1.1 christos 87 1.1 christos =head1 HISTORY 88 1.1 christos 89 1.1 christos Since OpenSSL 3.4 the SHAKE-128 and SHAKE-256 implementations have no default 90 1.1 christos digest length. 91 1.1 christos 92 1.1 christos =head1 COPYRIGHT 93 1.1 christos 94 1.1 christos Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved. 95 1.1 christos 96 1.1 christos Licensed under the Apache License 2.0 (the "License"). You may not use 97 1.1 christos this file except in compliance with the License. You can obtain a copy 98 1.1 christos in the file LICENSE in the source distribution or at 99 1.1 christos L<https://www.openssl.org/source/license.html>. 100 1.1 christos 101 1.1 christos =cut 102