openvm_stark_sdk/config/
baby_bear_keccak.rs

1use p3_keccak::Keccak256Hash;
2
3use super::baby_bear_bytehash::{
4    self, config_from_byte_hash, BabyBearByteHashConfig, BabyBearByteHashEngine,
5};
6use crate::{
7    assert_sc_compatible_with_serde,
8    config::{
9        baby_bear_bytehash::BabyBearByteHashEngineWithDefaultHash, fri_params::SecurityParameters,
10    },
11};
12
13pub type BabyBearKeccakConfig = BabyBearByteHashConfig<Keccak256Hash>;
14pub type BabyBearKeccakEngine = BabyBearByteHashEngine<Keccak256Hash>;
15
16assert_sc_compatible_with_serde!(BabyBearKeccakConfig);
17
18/// `pcs_log_degree` is the upper bound on the log_2(PCS polynomial degree).
19pub fn default_engine() -> BabyBearKeccakEngine {
20    baby_bear_bytehash::default_engine(Keccak256Hash)
21}
22
23/// `pcs_log_degree` is the upper bound on the log_2(PCS polynomial degree).
24pub fn default_config() -> BabyBearKeccakConfig {
25    config_from_byte_hash(Keccak256Hash, SecurityParameters::standard_fast())
26}
27
28impl BabyBearByteHashEngineWithDefaultHash<Keccak256Hash> for BabyBearKeccakEngine {
29    fn default_hash() -> Keccak256Hash {
30        Keccak256Hash
31    }
32}