Function blake2b_simd::finalize4
source · pub fn finalize4(
state0: &mut State,
state1: &mut State,
state2: &mut State,
state3: &mut State
) -> [Hash; 4]Expand description
Finalize four State objects at the same time.
This is the counterpart to update4. Like the regular finalize, this is idempotent.
Calling it multiple times on the same states will produce the same output, and it’s possible to
add more input in between calls.
Example
use blake2b_simd::{blake2b, finalize4, update4, State};
let mut state0 = State::new();
let mut state1 = State::new();
let mut state2 = State::new();
let mut state3 = State::new();
update4(
&mut state0,
&mut state1,
&mut state2,
&mut state3,
b"foo",
b"bar",
b"baz",
b"bing",
);
let parallel_hashes = finalize4(&mut state0, &mut state1, &mut state2, &mut state3);
let serial_hashes = [
blake2b(b"foo"),
blake2b(b"bar"),
blake2b(b"baz"),
blake2b(b"bing"),
];
assert_eq!(serial_hashes, parallel_hashes);