authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-16 02:24:36-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-16 02:24:36-07:00
log281fc10ec5aa8052490b9f951e0ceed1b7008ff4
treed5a58428e9014089bfad67bd14f2e56bbb98dec2
parent7801a6d17f59091b62ae130dcd14cdd5cd2f180e

std.crypto siphash: fix assertion on the size of output buffer

the logic was backwards

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

lib/std/crypto/siphash.zig+2-1
......@@ -218,8 +218,9 @@ fn SipHash(comptime T: type, comptime c_rounds: usize, comptime d_rounds: usize)
218218 }
219219
220220 /// Return an authentication tag for the current state
221 /// Assumes `out` is less than or equal to `mac_length`.
221222 pub fn final(self: *Self, out: []u8) void {
222 std.debug.assert(out.len >= mac_length);
223 std.debug.assert(out.len <= mac_length);
223224 mem.writeIntLittle(T, out[0..mac_length], self.state.final(self.buf[0..self.buf_len]));
224225 }
225226