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

Verifier tests #23

Merged
merged 8 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions barustenberg-benches/benches/a_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use criterion::{criterion_group, criterion_main, Criterion};

pub fn add_benchmark(c: &mut Criterion) {
let mut rvg = barustenberg::test_utils::Rvg::deterministic();
let int_val_1 = rvg.sample(&(0..100i32));
let int_val_2 = rvg.sample(&(0..100i32));
// let mut rvg = barustenberg::test_utils::Rvg::deterministic();
// let int_val_1 = rvg.sample(&(0..100i32));
// let int_val_2 = rvg.sample(&(0..100i32));

c.bench_function("add", |b| {
b.iter(|| {
barustenberg::add(int_val_1, int_val_2);
})
});
// c.bench_function("add", |b| {
// b.iter(|| {
// barustenberg::add(int_val_1, int_val_2);
// })
// });
}
criterion_group!(benches, add_benchmark);
criterion_main!(benches);
9 changes: 8 additions & 1 deletion barustenberg/src/plonk/composer/composer_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use crate::{
},
polynomials::Polynomial,
srs::reference_string::ReferenceStringFactory,
transcript::Manifest,
};

pub(crate) const DUMMY_TAG: u32 = 0;
Expand All @@ -40,6 +41,12 @@ pub(crate) enum ComposerType {
StandardHonk,
}

impl ComposerType {
pub(crate) fn create_manifest(self, _x: usize) -> Manifest {
unimplemented!("ComposerType::create_manifest")
}
}

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub(crate) struct CycleNode {
pub(crate) gate_index: u32,
Expand Down Expand Up @@ -652,7 +659,7 @@ pub(crate) trait ComposerBase {
let mut selector_poly = (*selector_poly).borrow_mut();
let selector_poly_coefficients = &mut selector_poly.coefficients;

let mut reference_string = (*proving_key.reference_string).borrow_mut();
let reference_string = (*proving_key.reference_string).borrow_mut();
let mut pippenger_runtime_state = proving_key.pippenger_runtime_state.clone();

// Commit to the constraint selector polynomial and insert the commitment in the verification key.
Expand Down
8 changes: 2 additions & 6 deletions barustenberg/src/plonk/proof_system/utils/permutation.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use ark_ec::AffineRepr;
use ark_ff::{FftField, Field};

use crate::{
Expand All @@ -19,10 +18,7 @@ pub(crate) struct PermutationSubgroupElement {
is_tag: bool,
}

pub(crate) fn compute_permutation_lagrange_base_single<
H: BarretenHasher,
Fr: Field + FftField,
>(
pub(crate) fn compute_permutation_lagrange_base_single<H: BarretenHasher, Fr: Field + FftField>(
output: &mut Polynomial<Fr>,
permutation: &[u32],
small_domain: &EvaluationDomain<Fr>,
Expand Down Expand Up @@ -87,4 +83,4 @@ pub(crate) fn compute_permutation_lagrange_base_single_helper<
}
}
}
}
}
4 changes: 2 additions & 2 deletions barustenberg/src/plonk/proof_system/verifier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use super::verification_key::VerificationKey;

use anyhow::{anyhow, Result};

// #[cfg(test)]
// mod test;
#[cfg(test)]
mod test;

#[derive(Debug)]
pub struct Verifier<H: BarretenHasher, S: Settings<Hasher = H, Field = Fr, Group = G1Affine>> {
Expand Down
Loading
Loading