EVP_MAC-BLAKE2.pod 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 can be set with EVP_MAC_CTX_set_params().
  18. Furthermore, the "size" parameter can be retrieved with
  19. EVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_mac_size().
  20. The length of the "size" parameter should not exceed that of a B<size_t>.
  21. Likewise, the "block-size" parameter can be retrieved with
  22. EVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_block_size().
  23. =over 4
  24. =item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
  25. Sets the MAC key.
  26. It may be at most 64 bytes for BLAKE2BMAC or 32 for BLAKE2SMAC and at
  27. least 1 byte in both cases.
  28. Setting this parameter is identical to passing a I<key> to L<EVP_MAC_init(3)>.
  29. =item "custom" (B<OSSL_MAC_PARAM_CUSTOM>) <octet string>
  30. Sets the custom value.
  31. It is an optional value of at most 16 bytes for BLAKE2BMAC or 8 for
  32. BLAKE2SMAC, and is empty by default.
  33. =item "salt" (B<OSSL_MAC_PARAM_SALT>) <octet string>
  34. Sets the salt.
  35. It is an optional value of at most 16 bytes for BLAKE2BMAC or 8 for
  36. BLAKE2SMAC, and is empty by default.
  37. =item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
  38. Sets the MAC size.
  39. It can be any number between 1 and 32 for EVP_MAC_BLAKE2S or between 1
  40. and 64 for EVP_MAC_BLAKE2B.
  41. It is 32 and 64 respectively by default.
  42. =item "block-size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
  43. Gets the MAC block size.
  44. By default, it is 64 for EVP_MAC_BLAKE2S and 128 for EVP_MAC_BLAKE2B.
  45. =back
  46. =head1 SEE ALSO
  47. L<EVP_MAC_CTX_get_params(3)>, L<EVP_MAC_CTX_set_params(3)>,
  48. L<EVP_MAC(3)/PARAMETERS>, L<OSSL_PARAM(3)>
  49. =head1 HISTORY
  50. The macros and functions described here were added to OpenSSL 3.0.
  51. =head1 COPYRIGHT
  52. Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
  53. Licensed under the Apache License 2.0 (the "License"). You may not use
  54. this file except in compliance with the License. You can obtain a copy
  55. in the file LICENSE in the source distribution or at
  56. L<https://www.openssl.org/source/license.html>.
  57. =cut