diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-04-29 00:19:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-29 00:19:55 -0700 |
| commit | d65b42e07caa00dfe2f2fbf221c593ce57882784 (patch) | |
| tree | 7926cbea1499e0affe930bf6d7455dc24adf014e /lib/std/crypto/hmac.zig | |
| parent | fd6200eda6d4fe19c34a59430a88a9ce38d6d7a4 (diff) | |
| parent | fa200ca0cad2705bad40eb723dedf4e3bf11f2ff (diff) | |
| download | zig-d65b42e07caa00dfe2f2fbf221c593ce57882784.tar.gz zig-d65b42e07caa00dfe2f2fbf221c593ce57882784.zip | |
Merge pull request #15481 from ziglang/use-mem-intrinsics
actually use the new memory intrinsics
Diffstat (limited to 'lib/std/crypto/hmac.zig')
| -rw-r--r-- | lib/std/crypto/hmac.zig | 8 |
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| { |
