| ... | @@ -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 | } |
| 148 | | 148 | |
| ... | @@ -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 | } |
| 179 | | 179 | |
| ... | @@ -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 | } |
| 214 | | 214 | |
| 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 | } |