mirror of
https://github.com/arnaucube/hyperplonk.git
synced 2026-01-12 00:51:27 +01:00
Optimize verifier eq (#102)
* wip we need to be able to do batch opening for different poly sizes or pad poly with zeros * fix small public inputs. Only works for pow2 pubinput Co-authored-by: Charles Chen <chancharles92@gmail.com>
This commit is contained in:
@@ -178,6 +178,8 @@ impl<F: PrimeField> SumCheckVerifier<F> for IOPVerifierState<F> {
|
||||
/// This implementation is linear in number of inputs in terms of field
|
||||
/// operations. It also has a quadratic term in primitive operations which is
|
||||
/// negligible compared to field operations.
|
||||
/// TODO: The quadratic term can be removed by precomputing the lagrange
|
||||
/// coefficients.
|
||||
fn interpolate_uni_poly<F: PrimeField>(p_i: &[F], eval_at: F) -> Result<F, PolyIOPErrors> {
|
||||
let start = start_timer!(|| "sum check interpolate uni poly opt");
|
||||
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
use std::fmt::Debug;
|
||||
|
||||
use crate::poly_iop::{errors::PolyIOPErrors, sum_check::SumCheck, PolyIOP};
|
||||
use arithmetic::build_eq_x_r;
|
||||
use arithmetic::eq_eval;
|
||||
use ark_ff::PrimeField;
|
||||
use ark_poly::MultilinearExtension;
|
||||
use ark_std::{end_timer, start_timer};
|
||||
use transcript::IOPTranscript;
|
||||
|
||||
@@ -103,11 +102,8 @@ impl<F: PrimeField> ZeroCheck<F> for PolyIOP<F> {
|
||||
|
||||
// expected_eval = sumcheck.expect_eval/eq(v, r)
|
||||
// where v = sum_check_sub_claim.point
|
||||
let eq_x_r = build_eq_x_r(&r)?;
|
||||
let expected_evaluation = sum_subclaim.expected_evaluation
|
||||
/ eq_x_r.evaluate(&sum_subclaim.point).ok_or_else(|| {
|
||||
PolyIOPErrors::InvalidParameters("evaluation dimension does not match".to_string())
|
||||
})?;
|
||||
let eq_x_r_eval = eq_eval(&sum_subclaim.point, &r)?;
|
||||
let expected_evaluation = sum_subclaim.expected_evaluation / eq_x_r_eval;
|
||||
|
||||
end_timer!(start);
|
||||
Ok(ZeroCheckSubClaim {
|
||||
|
||||
Reference in New Issue
Block a user