diff options
| author | Vexu <git@vexu.eu> | 2020-05-04 14:45:36 +0300 |
|---|---|---|
| committer | Vexu <git@vexu.eu> | 2020-05-04 14:45:36 +0300 |
| commit | 85fd484f0778b5f158dc76bf51b820314b86292d (patch) | |
| tree | 2aa70f92c42aabdf37fd3b068b549352c78d5390 /lib/std/crypto | |
| parent | adc444ceeb91c06a6ee84dc4e4874294a41dee45 (diff) | |
| download | zig-85fd484f0778b5f158dc76bf51b820314b86292d.tar.gz zig-85fd484f0778b5f158dc76bf51b820314b86292d.zip | |
std: fix blake3 assignment to constant
Diffstat (limited to 'lib/std/crypto')
| -rw-r--r-- | lib/std/crypto/blake3.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/crypto/blake3.zig b/lib/std/crypto/blake3.zig index 7c79ffcf55..08479d65a5 100644 --- a/lib/std/crypto/blake3.zig +++ b/lib/std/crypto/blake3.zig @@ -338,7 +338,7 @@ pub const Blake3 = struct { } // Section 5.1.2 of the BLAKE3 spec explains this algorithm in more detail. - fn add_chunk_chaining_value(self: *Blake3, new_cv: [8]u32, total_chunks: u64) void { + fn add_chunk_chaining_value(self: *Blake3, first_cv: [8]u32, total_chunks: u64) void { // This chunk might complete some subtrees. For each completed subtree, // its left child will be the current top entry in the CV stack, and // its right child will be the current value of `new_cv`. Pop each left @@ -346,6 +346,7 @@ pub const Blake3 = struct { // with the result. After all these merges, push the final value of // `new_cv` onto the stack. The number of completed subtrees is given // by the number of trailing 0-bits in the new total number of chunks. + var new_cv = first_cv; var chunk_counter = total_chunks; while (chunk_counter & 1 == 0) { new_cv = parent_cv(self.pop_cv(), new_cv, self.key, self.flags); |
