binius_hash/lib.rs
1// Copyright 2026 The Binius Developers
2
3#![warn(rustdoc::missing_crate_level_docs)]
4// A verifier's security must not rest on hand-written vector code, so this crate carries none.
5// The one exception is marked at its definition: filling a hash buffer implements an unsafe
6// trait from the buffer crate.
7#![deny(unsafe_code)]
8
9//! Hash and compression functions a Binius verifier depends on.
10//!
11//! Everything here is sequential and reference-driven: one block compression per node, one
12//! digest per leaf, no vector kernels and no thread pool.
13//!
14//! The batched and architecture-specific kernels a prover wants live in the prover-side
15//! crate, so nothing a verifier links against depends on them.
16
17pub mod blake3;
18pub mod compress;
19mod serialization;
20pub mod sha256;
21pub mod suite;
22
23pub use blake3::{Blake3Compression, Blake3HashSuite};
24pub use compress::CompressionFunction;
25pub use serialization::*;
26pub use sha256::{Sha256Compression, Sha256HashSuite};
27pub use suite::HashSuite;
28
29/// The standard digest is SHA-256.
30pub type StdDigest = sha2::Sha256;
31
32/// The standard two-to-one compression pairs with the standard digest.
33pub type StdCompression = sha256::Sha256Compression;
34
35/// The standard hash suite pairs the standard digest with the standard compression.
36pub type StdHashSuite = sha256::Sha256HashSuite;