authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-29 15:43:22-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-02 16:57:16-07:00
log7391df2be5143db8308ab7c5281842aea99cb1d7
tree6c868bc3da8e06e0299651bbd5fc7e3d77ac050e
parent1d20ada3665102ad09fec0ff486b22f4f0a56141

std.crypto: make proper use of `undefined`


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

lib/std/crypto/aegis.zig+2-2
......@@ -174,7 +174,7 @@ pub const Aegis128L = struct {
174174 acc |= (computed_tag[j] ^ tag[j]);
175175 }
176176 if (acc != 0) {
177 mem.set(u8, m, 0xaa);
177 @memset(m.ptr, undefined, m.len);
178178 return error.AuthenticationFailed;
179179 }
180180 }
......@@ -343,7 +343,7 @@ pub const Aegis256 = struct {
343343 acc |= (computed_tag[j] ^ tag[j]);
344344 }
345345 if (acc != 0) {
346 mem.set(u8, m, 0xaa);
346 @memset(m.ptr, undefined, m.len);
347347 return error.AuthenticationFailed;
348348 }
349349 }
lib/std/crypto/aes_gcm.zig+1-1
......@@ -91,7 +91,7 @@ fn AesGcm(comptime Aes: anytype) type {
9191 acc |= (computed_tag[p] ^ tag[p]);
9292 }
9393 if (acc != 0) {
94 mem.set(u8, m, 0xaa);
94 @memset(m.ptr, undefined, m.len);
9595 return error.AuthenticationFailed;
9696 }
9797