Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: poseidon port #180

Merged
merged 29 commits into from
Sep 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fmt
iammadab committed Sep 9, 2024
commit 883ebba7edc2385c1bacfa3862f3d6f5445dc7fe
6 changes: 6 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions mpcs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -47,4 +47,8 @@ print-trace = [ "ark-std/print-trace" ]

[[bench]]
name = "commit_open_verify"
harness = false

[[bench]]
name = "hashing"
harness = false
Empty file added mpcs/benches/hashing.rs
Empty file.
6 changes: 1 addition & 5 deletions mpcs/src/sum_check.rs
Original file line number Diff line number Diff line change
@@ -104,11 +104,7 @@ pub fn lagrange_eval<F: PrimeField>(x: &[F], b: usize) -> F {

product(x.iter().enumerate().map(
|(idx, x_i)| {
if b.nth_bit(idx) {
*x_i
} else {
F::ONE - x_i
}
if b.nth_bit(idx) { *x_i } else { F::ONE - x_i }
},
))
}
6 changes: 1 addition & 5 deletions mpcs/src/util/arithmetic.rs
Original file line number Diff line number Diff line change
@@ -134,11 +134,7 @@ pub fn modulus<F: PrimeField>() -> BigUint {
}

pub fn fe_from_bool<F: Field>(value: bool) -> F {
if value {
F::ONE
} else {
F::ZERO
}
if value { F::ONE } else { F::ZERO }
}

pub fn fe_mod_from_le_bytes<F: PrimeField>(bytes: impl AsRef<[u8]>) -> F {
4 changes: 3 additions & 1 deletion mpcs/src/util/merkle_tree.rs
Original file line number Diff line number Diff line change
@@ -58,7 +58,9 @@ where
pub fn get_leaf_as_base(&self, index: usize) -> E::BaseField {
match &self.leaves {
FieldType::Base(leaves) => leaves[index],
FieldType::Ext(_) => panic!("Mismatching field type, calling get_leaf_as_base on a Merkle tree over extension fields"),
FieldType::Ext(_) => panic!(
"Mismatching field type, calling get_leaf_as_base on a Merkle tree over extension fields"
),
FieldType::Unreachable => unreachable!(),
}
}
2 changes: 0 additions & 2 deletions sumcheck/src/structs.rs
Original file line number Diff line number Diff line change
@@ -16,8 +16,6 @@ pub struct IOPProof<E: ExtensionField> {
impl<E: ExtensionField> IOPProof<E> {
#[allow(dead_code)]
pub fn extract_sum(&self) -> E {


self.proofs[0].evaluations[0] + self.proofs[0].evaluations[1]
}
}