Skip to content

Commit

Permalink
fix: Merkle tree config (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirhemo authored Feb 16, 2024
1 parent 121e06b commit 1c9e4dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/utils/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ pub(super) mod baby_bear_keccak {
use p3_keccak::Keccak256Hash;
use p3_merkle_tree::FieldMerkleTreeMmcs;
use p3_poseidon2::{DiffusionMatrixBabybear, Poseidon2};
use p3_symmetric::{SerializingHasher32, TruncatedPermutation};
use p3_symmetric::{CompressionFunctionFromHasher, SerializingHasher32};
use serde::{Deserialize, Serialize};

use crate::stark::StarkGenericConfig;
Expand All @@ -322,7 +322,7 @@ pub(super) mod baby_bear_keccak {
pub type Perm = Poseidon2<Val, DiffusionMatrixBabybear, 16, 7>;
type MyHash = SerializingHasher32<Keccak256Hash>;

pub type MyCompress = TruncatedPermutation<Perm, 2, 8, 16>;
type MyCompress = CompressionFunctionFromHasher<Val, MyHash, 2, 8>;

pub type ValMmcs = FieldMerkleTreeMmcs<Val, MyHash, MyCompress, 8>;
pub type ChallengeMmcs = ExtensionMmcs<Val, Challenge, ValMmcs>;
Expand Down Expand Up @@ -363,7 +363,7 @@ pub(super) mod baby_bear_keccak {

let hash = MyHash::new(Keccak256Hash {});

let compress = MyCompress::new(perm.clone());
let compress = MyCompress::new(hash);

let val_mmcs = ValMmcs::new(hash, compress);

Expand Down Expand Up @@ -440,7 +440,7 @@ pub(super) mod baby_bear_blake3 {
use p3_fri::{FriConfig, TwoAdicFriPcs, TwoAdicFriPcsConfig};
use p3_merkle_tree::FieldMerkleTreeMmcs;
use p3_poseidon2::{DiffusionMatrixBabybear, Poseidon2};
use p3_symmetric::{SerializingHasher32, TruncatedPermutation};
use p3_symmetric::{CompressionFunctionFromHasher, SerializingHasher32};
use serde::{Deserialize, Serialize};

use crate::stark::StarkGenericConfig;
Expand All @@ -455,7 +455,7 @@ pub(super) mod baby_bear_blake3 {
pub type Perm = Poseidon2<Val, DiffusionMatrixBabybear, 16, 7>;
type MyHash = SerializingHasher32<Blake3>;

pub type MyCompress = TruncatedPermutation<Perm, 2, 8, 16>;
type MyCompress = CompressionFunctionFromHasher<Val, MyHash, 2, 8>;

pub type ValMmcs = FieldMerkleTreeMmcs<Val, MyHash, MyCompress, 8>;
pub type ChallengeMmcs = ExtensionMmcs<Val, Challenge, ValMmcs>;
Expand Down Expand Up @@ -499,7 +499,7 @@ pub(super) mod baby_bear_blake3 {
fn from_perm(perm: Perm) -> Self {
let hash = MyHash::new(Blake3 {});

let compress = MyCompress::new(perm.clone());
let compress = MyCompress::new(hash);

let val_mmcs = ValMmcs::new(hash, compress);

Expand Down

0 comments on commit 1c9e4dc

Please sign in to comment.