Skip to main content

binius_verifier/
config.rs

1// Copyright 2025 Irreducible Inc.
2//! Specifies standard trait implementations and parameters.
3
4use binius_core::word::Word;
5use binius_field::{BinaryField, BinaryField1b, Ghash128b, Rijndael8b};
6use binius_hash::StdDigest;
7use binius_transcript::fiat_shamir::{Challenger, HasherChallenger};
8use binius_utils::checked_arithmetics::checked_log_2;
9
10// Exports the binary fields that this system uses
11pub type B1 = BinaryField1b;
12pub type B128 = Ghash128b;
13
14/// The intention of this trait is to capture the moment when a StandardChallenger type is changed.
15pub trait ChallengerWithName: Challenger {
16	const NAME: &'static str;
17}
18
19impl ChallengerWithName for HasherChallenger<StdDigest> {
20	const NAME: &'static str = "HasherChallenger<Sha256>";
21}
22
23/// The default [`binius_transcript::fiat_shamir::Challenger`] implementation.
24pub type StdChallenger = HasherChallenger<StdDigest>;
25
26/// log2 of the number of [`Word`]s packed into one field element.
27pub const LOG_WORDS_PER_ELEM: usize = checked_log_2(B128::N_BITS) - Word::LOG_BITS;
28
29pub const PROVER_SMALL_FIELD_ZEROCHECK_CHALLENGES: [Rijndael8b; 3] = [
30	Rijndael8b::new(0x2),
31	Rijndael8b::new(0x4),
32	Rijndael8b::new(0x10),
33];