authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2022-11-11 18:04:22+01:00
committergravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2022-11-11 18:04:22+01:00
logdf7223c7f2504b8f98526a86630bd6a7c07720a9
tree0ca74b85a7cbaa8bacd6acc52703c79e4c199d41
parent4f285d4dacac82794ab71cc21c5ebf6bc6d6c48b

crypto.AesGcm: provision ghash for the final block


1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/crypto/aes_gcm.zig+1-1
......@@ -35,7 +35,7 @@ fn AesGcm(comptime Aes: anytype) type {
3535 mem.writeIntBig(u32, j[nonce_length..][0..4], 1);
3636 aes.encrypt(&t, &j);
3737
38 const block_count = (math.divCeil(usize, ad.len, Ghash.block_length) catch unreachable) + (math.divCeil(usize, c.len, Ghash.block_length) catch unreachable);
38 const block_count = (math.divCeil(usize, ad.len, Ghash.block_length) catch unreachable) + (math.divCeil(usize, c.len, Ghash.block_length) catch unreachable) + 1;
3939 var mac = Ghash.initForBlockCount(&h, block_count);
4040 mac.update(ad);
4141 mac.pad();