2
0

EVP_MAC-BLAKE2.pod 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. =pod
  2. =head1 NAME
  3. EVP_MAC-BLAKE2, EVP_MAC-BLAKE2BMAC, EVP_MAC-BLAKE2SMAC
  4. - The BLAKE2 EVP_MAC implementations
  5. =head1 DESCRIPTION
  6. Support for computing BLAKE2 MACs through the B<EVP_MAC> API.
  7. =head2 Identity
  8. These implementations are identified with one of these names and
  9. properties, to be used with EVP_MAC_fetch():
  10. =over 4
  11. =item "BLAKE2BMAC", "provider=default"
  12. =item "BLAKE2SMAC", "provider=default"
  13. =back
  14. =head2 Supported parameters
  15. The general description of these parameters can be found in
  16. L<EVP_MAC(3)/PARAMETERS>.
  17. All these parameters (except for "block-size") can be set with
  18. EVP_MAC_CTX_set_params().
  19. Furthermore, the "size" parameter can be retrieved with
  20. EVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_mac_size().
  21. The length of the "size" parameter should not exceed that of a B<size_t>.
  22. Likewise, the "block-size" parameter can be retrieved with
  23. EVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_block_size().
  24. =over 4
  25. =item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
  26. Sets the MAC key.
  27. It may be at most 64 bytes for BLAKE2BMAC or 32 for BLAKE2SMAC and at
  28. least 1 byte in both cases.
  29. Setting this parameter is identical to passing a I<key> to L<EVP_MAC_init(3)>.
  30. =item "custom" (B<OSSL_MAC_PARAM_CUSTOM>) <octet string>
  31. Sets the customization/personalization string.
  32. It is an optional value of at most 16 bytes for BLAKE2BMAC or 8 for
  33. BLAKE2SMAC, and is empty by default.
  34. =item "salt" (B<OSSL_MAC_PARAM_SALT>) <octet string>
  35. Sets the salt.
  36. It is an optional value of at most 16 bytes for BLAKE2BMAC or 8 for
  37. BLAKE2SMAC, and is empty by default.
  38. =item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
  39. Sets the MAC size.
  40. It can be any number between 1 and 32 for EVP_MAC_BLAKE2S or between 1
  41. and 64 for EVP_MAC_BLAKE2B.
  42. It is 32 and 64 respectively by default.
  43. =item "block-size" (B<OSSL_MAC_PARAM_BLOCK_SIZE>) <unsigned integer>
  44. Gets the MAC block size.
  45. It is 64 for EVP_MAC_BLAKE2S and 128 for EVP_MAC_BLAKE2B.
  46. =back
  47. =head1 SEE ALSO
  48. L<EVP_MAC_CTX_get_params(3)>, L<EVP_MAC_CTX_set_params(3)>,
  49. L<EVP_MAC(3)/PARAMETERS>, L<OSSL_PARAM(3)>
  50. =head1 HISTORY
  51. The macros and functions described here were added to OpenSSL 3.0.
  52. =head1 COPYRIGHT
  53. Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
  54. Licensed under the Apache License 2.0 (the "License"). You may not use
  55. this file except in compliance with the License. You can obtain a copy
  56. in the file LICENSE in the source distribution or at
  57. L<https://www.openssl.org/source/license.html>.
  58. =cut