diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-10-24 13:44:26 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2023-10-25 20:13:39 +0100 |
commit | 6a0ae393dd554eb718e5148696e8f437d4faae5b (patch) | |
tree | c263d550046a8373339a7b2241df3b1e6ab9c66e /doc | |
parent | c7ed5e4697a71012e0a2d9dd5eaf997754ae5156 (diff) |
Blake2b: Use OSSL_DIGEST_PARAM_SIZE as settable instead of XOFLEN
BLAKE2 is not really an extensible output function unlike SHAKE
as the digest size must be set during the context initialization.
Thus it makes no sense to use OSSL_DIGEST_PARAM_XOFLEN.
We also need to adjust EVP_DigestFinal_ex() to query the
OSSL_DIGEST_PARAM_SIZE as gettable ctx param for the size.
Fixes #22488
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22491)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/man3/EVP_DigestInit.pod | 8 | ||||
-rw-r--r-- | doc/man7/EVP_MD-BLAKE2.pod | 15 |
2 files changed, 20 insertions, 3 deletions
diff --git a/doc/man3/EVP_DigestInit.pod b/doc/man3/EVP_DigestInit.pod index 9b5fda08ee..409630e5d4 100644 --- a/doc/man3/EVP_DigestInit.pod +++ b/doc/man3/EVP_DigestInit.pod @@ -282,9 +282,11 @@ data. Retrieves the digest value from I<ctx> and places it in I<md>. If the I<s> parameter is not NULL then the number of bytes of data written (i.e. the length of the digest) will be written to the integer at I<s>, at most -B<EVP_MAX_MD_SIZE> bytes will be written. After calling EVP_DigestFinal_ex() -no additional calls to EVP_DigestUpdate() can be made, but -EVP_DigestInit_ex2() can be called to initialize a new digest operation. +B<EVP_MAX_MD_SIZE> bytes will be written unless the digest implementation +allows changing the digest size and it is set to a larger value by the +application. After calling EVP_DigestFinal_ex() no additional calls to +EVP_DigestUpdate() can be made, but EVP_DigestInit_ex2() can be called to +initialize a new digest operation. =item EVP_DigestFinalXOF() diff --git a/doc/man7/EVP_MD-BLAKE2.pod b/doc/man7/EVP_MD-BLAKE2.pod index f72d3da1ce..205b0c59be 100644 --- a/doc/man7/EVP_MD-BLAKE2.pod +++ b/doc/man7/EVP_MD-BLAKE2.pod @@ -30,6 +30,21 @@ Known names are "BLAKE2B-512" and "BLAKE2b512". This implementation supports the common gettable parameters described in L<EVP_MD-common(7)>. +=head2 Settable Context Parameters + +The BLAKE2B-512 implementation supports the following L<OSSL_PARAM(3)> entries, +settable for an B<EVP_MD_CTX> with L<EVP_MD_CTX_set_params(3)>: + +=over 4 + +=item "size" (B<OSSL_DIGEST_PARAM_SIZE>) <unsigned integer> + +Sets a different digest length for the L<EVP_DigestFinal(3)> output. +The value of the "size" parameter should not exceed 255 and it must be set +during the L<EVP_DigestInit_ex2(3)> call. + +=back + =head1 SEE ALSO L<provider-digest(7)>, L<OSSL_PROVIDER-default(7)> |