commit 4e14a7abd2ba1ee42f7ce61fb30aac2832846faa
parent 8a06f9ea51f7d47eefc5947f96d883602a85c7af
Author: Pinghao Wu <xdavidwuph@gmail.com>
Date: Thu, 8 Jun 2023 21:28:56 +0800
crypto::argon2: fix zeroing of h0
Before this, the slice length was miscalculated: h0 is [64]u8, we need
to zero 64 bytes here, not len(h0) * size(u64).
Signed-off-by: Pinghao Wu <xdavidwuph@gmail.com>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/argon2/argon2.ha b/crypto/argon2/argon2.ha
@@ -231,7 +231,7 @@ fn argon2(
varhash(dest, b);
- bytes::zero((h0: []u64: *[*]u8)[..len(h0) * size(u64)]);
+ bytes::zero(h0);
bytes::zero((ctx.mem: *[*]u8)[..len(ctx.mem) * size(u64)]);
if (cfg.mem is u32) {