aboutsummaryrefslogtreecommitdiff
path: root/lib/std/crypto/hmac.zig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/crypto/hmac.zig')
-rw-r--r--lib/std/crypto/hmac.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/crypto/hmac.zig b/lib/std/crypto/hmac.zig
index f279132ee8..8d0daa3032 100644
--- a/lib/std/crypto/hmac.zig
+++ b/lib/std/crypto/hmac.zig
@@ -38,12 +38,12 @@ pub fn Hmac(comptime Hash: type) type {
// Normalize key length to block size of hash
if (key.len > Hash.block_length) {
Hash.hash(key, scratch[0..mac_length], .{});
- mem.set(u8, scratch[mac_length..Hash.block_length], 0);
+ @memset(scratch[mac_length..Hash.block_length], 0);
} else if (key.len < Hash.block_length) {
- mem.copy(u8, scratch[0..key.len], key);
- mem.set(u8, scratch[key.len..Hash.block_length], 0);
+ @memcpy(scratch[0..key.len], key);
+ @memset(scratch[key.len..Hash.block_length], 0);
} else {
- mem.copy(u8, scratch[0..], key);
+ @memcpy(&scratch, key);
}
for (&ctx.o_key_pad, 0..) |*b, i| {