binius_circuits/blake2b/
mod.rs1pub mod circuit;
3pub mod constants;
4pub mod reference;
5
6#[cfg(test)]
7mod tests;
8
9pub use circuit::Blake2bCircuit;
10pub use constants::*;
11pub use reference::blake2b;
12
13#[cfg(test)]
15pub mod test_constants {
16 use blake2::{Blake2b512, Digest};
17
18 pub fn ground_truth_blake2b(input: &[u8]) -> [u8; 64] {
20 let mut hasher = Blake2b512::new();
21 hasher.update(input);
22 hasher.finalize().into()
23 }
24
25 pub fn hex_string(bytes: &[u8]) -> String {
27 bytes
28 .iter()
29 .map(|b| format!("{:02x}", b))
30 .collect::<String>()
31 }
32}