zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 7391df2be5143db8308ab7c5281842aea99cb1d7 (tree)
parent 1d20ada3665102ad09fec0ff486b22f4f0a56141
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu, 29 Dec 2022 15:43:22 -0700

std.crypto: make proper use of `undefined`

Diffstat:
Mlib/std/crypto/aegis.zig | 4++--
Mlib/std/crypto/aes_gcm.zig | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/std/crypto/aegis.zig b/lib/std/crypto/aegis.zig @@ -174,7 +174,7 @@ pub const Aegis128L = struct { acc |= (computed_tag[j] ^ tag[j]); } if (acc != 0) { - mem.set(u8, m, 0xaa); + @memset(m.ptr, undefined, m.len); return error.AuthenticationFailed; } } @@ -343,7 +343,7 @@ pub const Aegis256 = struct { acc |= (computed_tag[j] ^ tag[j]); } if (acc != 0) { - mem.set(u8, m, 0xaa); + @memset(m.ptr, undefined, m.len); return error.AuthenticationFailed; } } diff --git a/lib/std/crypto/aes_gcm.zig b/lib/std/crypto/aes_gcm.zig @@ -91,7 +91,7 @@ fn AesGcm(comptime Aes: anytype) type { acc |= (computed_tag[p] ^ tag[p]); } if (acc != 0) { - mem.set(u8, m, 0xaa); + @memset(m.ptr, undefined, m.len); return error.AuthenticationFailed; }