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/blake3.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/blake3.zig')
| -rw-r--r-- | lib/std/crypto/blake3.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/crypto/blake3.zig b/lib/std/crypto/blake3.zig index 36d717387f..fb580fda13 100644 --- a/lib/std/crypto/blake3.zig +++ b/lib/std/crypto/blake3.zig @@ -253,7 +253,7 @@ const Output = struct { while (out_word_it.next()) |out_word| { var word_bytes: [4]u8 = undefined; mem.writeIntLittle(u32, &word_bytes, words[word_counter]); - mem.copy(u8, out_word, word_bytes[0..out_word.len]); + @memcpy(out_word, word_bytes[0..out_word.len]); word_counter += 1; } output_block_counter += 1; @@ -284,7 +284,7 @@ const ChunkState = struct { fn fillBlockBuf(self: *ChunkState, input: []const u8) []const u8 { const want = BLOCK_LEN - self.block_len; const take = math.min(want, input.len); - mem.copy(u8, self.block[self.block_len..][0..take], input[0..take]); + @memcpy(self.block[self.block_len..][0..take], input[0..take]); self.block_len += @truncate(u8, take); return input[take..]; } @@ -336,8 +336,8 @@ fn parentOutput( flags: u8, ) Output { var block_words: [16]u32 align(16) = undefined; - mem.copy(u32, block_words[0..8], left_child_cv[0..]); - mem.copy(u32, block_words[8..], right_child_cv[0..]); + block_words[0..8].* = left_child_cv; + block_words[8..].* = right_child_cv; return Output{ .input_chaining_value = key, .block_words = block_words, |
