openssl/doc/life-cycles/digest.dot
slontis 5366490822 Add EVP_DigestSqueeze() API.
Fixes #7894

This allows SHAKE to squeeze multiple times with different output sizes.

The existing EVP_DigestFinalXOF() API has been left as a one shot
operation. A similar interface is used by another toolkit.

The low level SHA3_Squeeze() function needed to change slightly so
that it can handle multiple squeezes. This involves changing the
assembler code so that it passes a boolean to indicate whether
the Keccak function should be called on entry.
At the provider level, the squeeze is buffered, so that it only requests
a multiple of the blocksize when SHA3_Squeeze() is called. On the first
call the value is zero, on subsequent calls the value passed is 1.

This PR is derived from the excellent work done by @nmathewson in
https://github.com/openssl/openssl/pull/7921

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21511)
2023-11-10 13:27:00 +01:00

36 lines
1.8 KiB
Plaintext

digraph digest {
bgcolor="transparent";
begin [label=start, color="#deeaee", style="filled"];
newed [label=newed, fontcolor="#c94c4c", style="solid"];
initialised [label=initialised, fontcolor="#c94c4c"];
updated [label=updated, fontcolor="#c94c4c"];
finaled [label="finaled", fontcolor="#c94c4c"];
squeezed [label="squeezed", fontcolor="#c94c4c"];
end [label="freed", color="#deeaee", style="filled"];
begin -> newed [label="EVP_MD_CTX_new"];
newed -> initialised [label="EVP_DigestInit", weight=100];
initialised -> updated [label="EVP_DigestUpdate", weight=100];
updated -> updated [label="EVP_DigestUpdate"];
updated -> finaled [label="EVP_DigestFinal", weight=2];
updated -> finaled [label="EVP_DigestFinalXOF",
fontcolor="#808080", color="#808080"];
updated -> squeezed [label="EVP_DigestSqueeze", weight=3];
finaled -> end [label="EVP_MD_CTX_free"];
finaled -> newed [label="EVP_MD_CTX_reset", style=dashed,
color="#034f84", fontcolor="#034f84"];
updated -> newed [label="EVP_MD_CTX_reset", style=dashed,
color="#034f84", fontcolor="#034f84"];
updated -> initialised [label="EVP_DigestInit", style=dashed,
color="#034f84", fontcolor="#034f84"];
finaled -> initialised [label="EVP_DigestInit", style=dashed,
color="#034f84", fontcolor="#034f84"];
squeezed -> squeezed [label="EVP_DigestSqueeze"];
squeezed -> end [label="EVP_MD_CTX_free", weight=1];
squeezed -> newed [label="EVP_MD_CTX_reset", style=dashed,
color="#034f84", fontcolor="#034f84"];
squeezed -> initialised [label="EVP_DigestInit", style=dashed,
color="#034f84", fontcolor="#034f84"];
}