xref: /freebsd/crypto/openssl/doc/man7/EVP_MAC-BLAKE2.pod (revision e0c4386e7e71d93b0edc0c8fa156263fc4a8b0b6)
1b077aed3SPierre Pronchery=pod
2b077aed3SPierre Pronchery
3b077aed3SPierre Pronchery=head1 NAME
4b077aed3SPierre Pronchery
5b077aed3SPierre ProncheryEVP_MAC-BLAKE2, EVP_MAC-BLAKE2BMAC, EVP_MAC-BLAKE2SMAC
6b077aed3SPierre Pronchery- The BLAKE2 EVP_MAC implementations
7b077aed3SPierre Pronchery
8b077aed3SPierre Pronchery=head1 DESCRIPTION
9b077aed3SPierre Pronchery
10b077aed3SPierre ProncherySupport for computing BLAKE2 MACs through the B<EVP_MAC> API.
11b077aed3SPierre Pronchery
12b077aed3SPierre Pronchery=head2 Identity
13b077aed3SPierre Pronchery
14b077aed3SPierre ProncheryThese implementations are identified with one of these names and
15b077aed3SPierre Proncheryproperties, to be used with EVP_MAC_fetch():
16b077aed3SPierre Pronchery
17b077aed3SPierre Pronchery=over 4
18b077aed3SPierre Pronchery
19b077aed3SPierre Pronchery=item "BLAKE2BMAC", "provider=default"
20b077aed3SPierre Pronchery
21b077aed3SPierre Pronchery=item "BLAKE2SMAC", "provider=default"
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
30*e0c4386eSCy SchubertAll these parameters (except for "block-size") can be set with
31*e0c4386eSCy SchubertEVP_MAC_CTX_set_params().
32b077aed3SPierre ProncheryFurthermore, the "size" parameter can be retrieved with
33b077aed3SPierre ProncheryEVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_mac_size().
34b077aed3SPierre ProncheryThe length of the "size" parameter should not exceed that of a B<size_t>.
35b077aed3SPierre ProncheryLikewise, the "block-size" parameter can be retrieved with
36b077aed3SPierre ProncheryEVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_block_size().
37b077aed3SPierre Pronchery
38b077aed3SPierre Pronchery=over 4
39b077aed3SPierre Pronchery
40b077aed3SPierre Pronchery=item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
41b077aed3SPierre Pronchery
42b077aed3SPierre ProncherySets the MAC key.
43b077aed3SPierre ProncheryIt may be at most 64 bytes for BLAKE2BMAC or 32 for BLAKE2SMAC and at
44b077aed3SPierre Proncheryleast 1 byte in both cases.
45b077aed3SPierre ProncherySetting this parameter is identical to passing a I<key> to L<EVP_MAC_init(3)>.
46b077aed3SPierre Pronchery
47b077aed3SPierre Pronchery=item "custom" (B<OSSL_MAC_PARAM_CUSTOM>) <octet string>
48b077aed3SPierre Pronchery
49*e0c4386eSCy SchubertSets the customization/personalization string.
50b077aed3SPierre ProncheryIt is an optional value of at most 16 bytes for BLAKE2BMAC or 8 for
51b077aed3SPierre ProncheryBLAKE2SMAC, and is empty by default.
52b077aed3SPierre Pronchery
53b077aed3SPierre Pronchery=item "salt" (B<OSSL_MAC_PARAM_SALT>) <octet string>
54b077aed3SPierre Pronchery
55b077aed3SPierre ProncherySets the salt.
56b077aed3SPierre ProncheryIt is an optional value of at most 16 bytes for BLAKE2BMAC or 8 for
57b077aed3SPierre ProncheryBLAKE2SMAC, and is empty by default.
58b077aed3SPierre Pronchery
59b077aed3SPierre Pronchery=item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
60b077aed3SPierre Pronchery
61b077aed3SPierre ProncherySets the MAC size.
62b077aed3SPierre ProncheryIt can be any number between 1 and 32 for EVP_MAC_BLAKE2S or between 1
63b077aed3SPierre Proncheryand 64 for EVP_MAC_BLAKE2B.
64b077aed3SPierre ProncheryIt is 32 and 64 respectively by default.
65b077aed3SPierre Pronchery
66*e0c4386eSCy Schubert=item "block-size" (B<OSSL_MAC_PARAM_BLOCK_SIZE>) <unsigned integer>
67b077aed3SPierre Pronchery
68b077aed3SPierre ProncheryGets the MAC block size.
69*e0c4386eSCy SchubertIt is 64 for EVP_MAC_BLAKE2S and 128 for EVP_MAC_BLAKE2B.
70b077aed3SPierre Pronchery
71b077aed3SPierre Pronchery=back
72b077aed3SPierre Pronchery
73b077aed3SPierre Pronchery=head1 SEE ALSO
74b077aed3SPierre Pronchery
75b077aed3SPierre ProncheryL<EVP_MAC_CTX_get_params(3)>, L<EVP_MAC_CTX_set_params(3)>,
76b077aed3SPierre ProncheryL<EVP_MAC(3)/PARAMETERS>, L<OSSL_PARAM(3)>
77b077aed3SPierre Pronchery
78b077aed3SPierre Pronchery=head1 HISTORY
79b077aed3SPierre Pronchery
80b077aed3SPierre ProncheryThe macros and functions described here were added to OpenSSL 3.0.
81b077aed3SPierre Pronchery
82b077aed3SPierre Pronchery=head1 COPYRIGHT
83b077aed3SPierre Pronchery
84b077aed3SPierre ProncheryCopyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
85b077aed3SPierre Pronchery
86b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
87b077aed3SPierre Proncherythis file except in compliance with the License.  You can obtain a copy
88b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at
89b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>.
90b077aed3SPierre Pronchery
91b077aed3SPierre Pronchery=cut
92