| ... | ... | @@ -35,7 +35,7 @@ fn AesGcm(comptime Aes: anytype) type { |
| 35 | 35 | mem.writeIntBig(u32, j[nonce_length..][0..4], 1); |
| 36 | 36 | aes.encrypt(&t, &j); |
| 37 | 37 | |
| 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; |
| 39 | 39 | var mac = Ghash.initForBlockCount(&h, block_count); |
| 40 | 40 | mac.update(ad); |
| 41 | 41 | mac.pad(); |