Skip to content

Commit

Permalink
use reverted poseidon2
Browse files Browse the repository at this point in the history
  • Loading branch information
kevjue committed Mar 4, 2024
1 parent c91ce79 commit 1fb3f9a
Show file tree
Hide file tree
Showing 15 changed files with 296 additions and 299 deletions.
74 changes: 37 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 7 additions & 10 deletions core/src/utils/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,7 @@ pub(super) mod baby_bear_poseidon2 {

pub type Challenge = BinomialExtensionField<Val, 4>;

const ROUNDS_F: usize = 8;
const ROUNDS_P: usize = 22;
const NUM_ROUNDS: usize = ROUNDS_F + ROUNDS_P;
pub type Perm = Poseidon2<Val, DiffusionMatrixBabybear, 16, NUM_ROUNDS, ROUNDS_F, ROUNDS_P, 5>;
pub type Perm = Poseidon2<Val, DiffusionMatrixBabybear, 16, 5>;
pub type MyHash = PaddingFreeSponge<Perm, 16, 8, 8>;

pub type MyCompress = TruncatedPermutation<Perm, 2, 8, 16>;
Expand Down Expand Up @@ -238,15 +235,15 @@ pub(super) mod baby_bear_poseidon2 {

impl BabyBearPoseidon2 {
pub fn new() -> Self {
let perm = Perm::new(*RC_16_30, DiffusionMatrixBabybear);
let perm = Perm::new(8, 22, RC_16_30.to_vec(), DiffusionMatrixBabybear);

let hash = MyHash::new(perm);
let hash = MyHash::new(perm.clone());

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

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

let challenge_mmcs = ChallengeMmcs::new(val_mmcs);
let challenge_mmcs = ChallengeMmcs::new(val_mmcs.clone());

let dft = Dft {};

Expand All @@ -266,7 +263,7 @@ pub(super) mod baby_bear_poseidon2 {
type UniConfig = Self;

fn challenger(&self) -> Self::Challenger {
Challenger::new(self.perm)
Challenger::new(self.perm.clone())
}

fn uni_stark_config(&self) -> &Self::UniConfig {
Expand Down Expand Up @@ -364,7 +361,7 @@ pub(super) mod baby_bear_keccak {

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

let challenge_mmcs = ChallengeMmcs::new(val_mmcs);
let challenge_mmcs = ChallengeMmcs::new(val_mmcs.clone());

Check failure on line 364 in core/src/utils/prove.rs

View workflow job for this annotation

GitHub Actions / Formatting & Clippy

using `clone` on type `FieldMerkleTreeMmcs<BabyBear, u8, SerializingHasher32<Keccak256Hash>, CompressionFunctionFromHasher<u8, Keccak256Hash, 2, 32>, 32>` which implements the `Copy` trait

let dft = Dft {};

Expand Down
Loading

0 comments on commit 1fb3f9a

Please sign in to comment.