aboutsummaryrefslogtreecommitdiff
path: root/lib/std/std.zig
diff options
context:
space:
mode:
authorFrank Denis <github@pureftpd.org>2020-10-26 13:23:16 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-10-29 15:18:37 -0400
commit26793453a7cf2016ae6fa7ad3d649dca150b53f5 (patch)
treecb174c663085e6908335350622e39de1bd4f181d /lib/std/std.zig
parent32e65c3f96b5418acf4d444714facbba98790a91 (diff)
downloadzig-26793453a7cf2016ae6fa7ad3d649dca150b53f5.tar.gz
zig-26793453a7cf2016ae6fa7ad3d649dca150b53f5.zip
std/crypto/blake2b: allow the initial output length to be set
BLAKE2 includes the expected output length in the initial state. This length is actually distinct from the actual output length used at finalization. BLAKE2b-256/128 is thus not the same as BLAKE2b-128. This behavior can be a little bit surprising, and has been "fixed" in BLAKE3. In order to support this, we may want to provide an option to set the length used for domain separation. In Zig, there is another reason to allow this: we assume that the output length is defined at comptime. But BLAKE2 doesn't have a fixed output length. For an output length that is not known at comptime, we can't take the full block size and truncate it due to the reason above. What we can do now is set that length as an option to get the correct initial state, and truncate the output if necessary.
Diffstat (limited to 'lib/std/std.zig')
0 files changed, 0 insertions, 0 deletions