Skip to content

Commit

Permalink
Modify lookup poly evaluator for the convenience of verification in p…
Browse files Browse the repository at this point in the history
…lonk example (#15)

* Cumulative changes to stwo

Co-authored-by: PayneJoe <[email protected]>

* temp change: flip the sign on mul in plonk; this temp change may be discarded

* allow small blowup

* add tiny blowup

* parallel sha256

* change publicity of sampled_values_to_mask

* add evaluation hint on PointEvaluator

* three constraints (batched)

* fix publicity of alpha_powers in lookup elements

* remove bws sha256 files

* Update sha256.rs

* Update sha256.rs

* Update mod.rs

* Update mod.rs

* Update mod.rs

* Update crates/prover/src/constraint_framework/point.rs

* Apply suggestions from code review

---------

Co-authored-by: Weikeng Chen <[email protected]>
  • Loading branch information
PayneJoe and weikengchen authored Aug 23, 2024
1 parent ead66f3 commit a79344c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/prover/src/constraint_framework/logup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<const BATCH_SIZE: usize, E: EvalAtRow> LogupAtRow<BATCH_SIZE, E> {
pub struct LookupElements<const N: usize> {
pub z: SecureField,
pub alpha: SecureField,
alpha_powers: [SecureField; N],
pub alpha_powers: [SecureField; N],
}
impl<const N: usize> LookupElements<N> {
pub fn draw(channel: &mut impl Channel) -> Self {
Expand Down
7 changes: 5 additions & 2 deletions crates/prover/src/constraint_framework/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::core::ColumnVec;
pub struct PointEvaluator<'a> {
pub mask: TreeVec<&'a ColumnVec<Vec<SecureField>>>,
pub evaluation_accumulator: &'a mut PointEvaluationAccumulator,
pub evaluation_hint: Vec<SecureField>,
pub col_index: Vec<usize>,
pub denom_inverse: SecureField,
}
Expand All @@ -24,6 +25,7 @@ impl<'a> PointEvaluator<'a> {
Self {
mask,
evaluation_accumulator,
evaluation_hint: vec![],
col_index,
denom_inverse,
}
Expand All @@ -48,8 +50,9 @@ impl<'a> EvalAtRow for PointEvaluator<'a> {
where
Self::EF: Mul<G, Output = Self::EF>,
{
self.evaluation_accumulator
.accumulate(self.denom_inverse * constraint);
let evaluation = self.denom_inverse * constraint;
self.evaluation_hint.push(evaluation);
self.evaluation_accumulator.accumulate(evaluation);
}
fn combine_ef(values: [Self::F; SECURE_EXTENSION_DEGREE]) -> Self::EF {
SecureField::from_partial_evals(values)
Expand Down

0 comments on commit a79344c

Please sign in to comment.