EVP_MD-SHAKE.pod 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. =pod
  2. =head1 NAME
  3. EVP_MD-SHAKE, EVP_MD-KECCAK-KMAC
  4. - The SHAKE / KECCAK family EVP_MD implementations
  5. =head1 DESCRIPTION
  6. Support for computing SHAKE or KECCAK-KMAC digests through the
  7. B<EVP_MD> API.
  8. KECCAK-KMAC is an Extendable Output Function (XOF), with a definition
  9. similar to SHAKE, used by the KMAC EVP_MAC implementation (see
  10. L<EVP_MAC-KMAC(7)>).
  11. =head2 Identities
  12. This implementation is available in the FIPS provider as well as the default
  13. provider, and includes the following varieties:
  14. =over 4
  15. =item KECCAK-KMAC-128
  16. Known names are "KECCAK-KMAC-128" and "KECCAK-KMAC128". This is used
  17. by L<EVP_MAC-KMAC128(7)>. Using the notation from NIST FIPS 202
  18. (Section 6.2), we have S<KECCAK-KMAC-128(M, d)> = S<KECCAK[256](M || 00, d)>
  19. (see the description of KMAC128 in Appendix A of NIST SP 800-185).
  20. =item KECCAK-KMAC-256
  21. Known names are "KECCAK-KMAC-256" and "KECCAK-KMAC256". This is used
  22. by L<EVP_MAC-KMAC256(7)>. Using the notation from NIST FIPS 202
  23. (Section 6.2), we have S<KECCAK-KMAC-256(M, d)> = S<KECCAK[512](M || 00, d)>
  24. (see the description of KMAC256 in Appendix A of NIST SP 800-185).
  25. =item SHAKE-128
  26. Known names are "SHAKE-128" and "SHAKE128".
  27. =item SHAKE-256
  28. Known names are "SHAKE-256" and "SHAKE256".
  29. =back
  30. =head2 Gettable Parameters
  31. This implementation supports the common gettable parameters described
  32. in L<EVP_MD-common(7)>.
  33. =head2 Settable Context Parameters
  34. These implementations support the following L<OSSL_PARAM(3)> entries,
  35. settable for an B<EVP_MD_CTX> with L<EVP_MD_CTX_set_params(3)>:
  36. =over 4
  37. =item "xoflen" (B<OSSL_DIGEST_PARAM_XOFLEN>) <unsigned integer>
  38. Sets the digest length for extendable output functions.
  39. The length of the "xoflen" parameter should not exceed that of a B<size_t>.
  40. For backwards compatibility reasons the default xoflen length for SHAKE-128 is
  41. 16 (bytes) which results in a security strength of only 64 bits. To ensure the
  42. maximum security strength of 128 bits, the xoflen should be set to at least 32.
  43. For backwards compatibility reasons the default xoflen length for SHAKE-256 is
  44. 32 (bytes) which results in a security strength of only 128 bits. To ensure the
  45. maximum security strength of 256 bits, the xoflen should be set to at least 64.
  46. This parameter may be used when calling either EVP_DigestFinal_ex() or
  47. EVP_DigestFinal(), since these functions were not designed to handle variable
  48. length output. It is recommended to either use EVP_DigestSqueeze() or
  49. EVP_DigestFinalXOF() instead.
  50. =back
  51. =head1 NOTES
  52. For SHAKE-128, to ensure the maximum security strength of 128 bits, the output
  53. length passed to EVP_DigestFinalXOF() should be at least 32.
  54. For SHAKE-256, to ensure the maximum security strength of 256 bits, the output
  55. length passed to EVP_DigestFinalXOF() should be at least 64.
  56. =head1 SEE ALSO
  57. L<EVP_MD_CTX_set_params(3)>, L<provider-digest(7)>, L<OSSL_PROVIDER-default(7)>
  58. =head1 COPYRIGHT
  59. Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
  60. Licensed under the Apache License 2.0 (the "License"). You may not use
  61. this file except in compliance with the License. You can obtain a copy
  62. in the file LICENSE in the source distribution or at
  63. L<https://www.openssl.org/source/license.html>.
  64. =cut