1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
use super::delta; use crate::commitment_scheme::kzg10::Commitment; use crate::proof_system::linearisation_poly::ProofEvaluations; use dusk_bls12_381::{G1Affine, Scalar}; #[derive(Debug)] pub struct VerifierKey { pub q_range: Commitment, } impl VerifierKey { pub(crate) fn compute_linearisation_commitment( &self, range_separation_challenge: &Scalar, scalars: &mut Vec<Scalar>, points: &mut Vec<G1Affine>, evaluations: &ProofEvaluations, ) { let four = Scalar::from(4); let kappa = range_separation_challenge.square(); let kappa_sq = kappa.square(); let kappa_cu = kappa_sq * kappa; let b_1 = delta(evaluations.c_eval - (four * evaluations.d_eval)); let b_2 = delta(evaluations.b_eval - four * evaluations.c_eval) * kappa; let b_3 = delta(evaluations.a_eval - four * evaluations.b_eval) * kappa_sq; let b_4 = delta(evaluations.d_next_eval - (four * evaluations.a_eval)) * kappa_cu; scalars.push((b_1 + b_2 + b_3 + b_4) * range_separation_challenge); points.push(self.q_range.0); } }