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