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