authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-16 18:10:41-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-16 18:10:41-07:00
loge6bfa377d1144d95cbf42d340852d272044d03f2
tree8a9bcacba469bec1f93a3f34b2a9dbcc973c64a0
parent8b3c1ed7342950fd76a4aff6c7565789a71d9e61

std.crypto.isap: fix callsites of secureZero


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

lib/std/crypto/isap.zig+4-4
...@@ -142,7 +142,7 @@ pub const IsapA128A = struct {...@@ -142,7 +142,7 @@ pub const IsapA128A = struct {
142 while (j < out_len) : (j += 8) {142 while (j < out_len) : (j += 8) {
143 mem.writeIntBig(u64, out[j..][0..8], isap.block[j / 8]);143 mem.writeIntBig(u64, out[j..][0..8], isap.block[j / 8]);
144 }144 }
145 mem.secureZero(u64, &isap.block);145 std.crypto.utils.secureZero(u64, &isap.block);
146 return out;146 return out;
147 }147 }
148148
...@@ -173,7 +173,7 @@ pub const IsapA128A = struct {...@@ -173,7 +173,7 @@ pub const IsapA128A = struct {
173 var tag: [16]u8 = undefined;173 var tag: [16]u8 = undefined;
174 mem.writeIntBig(u64, tag[0..8], isap.block[0]);174 mem.writeIntBig(u64, tag[0..8], isap.block[0]);
175 mem.writeIntBig(u64, tag[8..16], isap.block[1]);175 mem.writeIntBig(u64, tag[8..16], isap.block[1]);
176 mem.secureZero(u64, &isap.block);176 std.crypto.utils.secureZero(u64, &isap.block);
177 return tag;177 return tag;
178 }178 }
179179
...@@ -209,7 +209,7 @@ pub const IsapA128A = struct {...@@ -209,7 +209,7 @@ pub const IsapA128A = struct {
209 break;209 break;
210 }210 }
211 }211 }
212 mem.secureZero(u64, &isap.block);212 std.crypto.utils.secureZero(u64, &isap.block);
213 }213 }
214214
215 pub fn encrypt(c: []u8, tag: *[tag_length]u8, m: []const u8, ad: []const u8, npub: [nonce_length]u8, key: [key_length]u8) void {215 pub fn encrypt(c: []u8, tag: *[tag_length]u8, m: []const u8, ad: []const u8, npub: [nonce_length]u8, key: [key_length]u8) void {
...@@ -223,7 +223,7 @@ pub const IsapA128A = struct {...@@ -223,7 +223,7 @@ pub const IsapA128A = struct {
223 for (computed_tag) |_, j| {223 for (computed_tag) |_, j| {
224 acc |= (computed_tag[j] ^ tag[j]);224 acc |= (computed_tag[j] ^ tag[j]);
225 }225 }
226 mem.secureZero(u8, &computed_tag);226 std.crypto.utils.secureZero(u8, &computed_tag);
227 if (acc != 0) {227 if (acc != 0) {
228 return error.AuthenticationFailed;228 return error.AuthenticationFailed;
229 }229 }