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