mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
std.crypto: make proper use of undefined
This commit is contained in:
parent
1d20ada366
commit
7391df2be5
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user