std.crypto: make proper use of undefined

This commit is contained in:
Andrew Kelley 2022-12-29 15:43:22 -07:00
parent 1d20ada366
commit 7391df2be5
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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;
}