mirror of
https://github.com/arnaucube/sonobe.git
synced 2026-02-02 17:26:44 +01:00
Add CommitmentProver trait, and add KZG prover to it (#62)
* Add KZG commitment scheme adapted to vector commitment Add KZG commitment scheme adapted to vector commitment Also move the `src/pedersen.rs` into `src/commitment/pedersen.rs` where it will coexist with `kzg.rs` and the trait defined in `src/commitment/mod.rs`. * Adapt Pedersen into the new CommitmentProver trait * add CommitmentProver (Pedersen&KZG) homomorphic property test * polishing * Use divide_with_q_and_r, rename skip_first_zero_coeffs Co-authored-by: han0110 <tinghan0110@gmail.com> --------- Co-authored-by: han0110 <tinghan0110@gmail.com>
This commit is contained in:
@@ -7,8 +7,11 @@ use ark_ec::{CurveGroup, Group};
|
||||
use ark_std::fmt::Debug;
|
||||
use ark_std::{One, Zero};
|
||||
|
||||
use crate::commitment::{
|
||||
pedersen::{Params as PedersenParams, Pedersen},
|
||||
CommitmentProver,
|
||||
};
|
||||
use crate::folding::circuits::nonnative::point_to_nonnative_limbs;
|
||||
use crate::pedersen::{Params as PedersenParams, Pedersen};
|
||||
use crate::utils::vec::is_zero_vec;
|
||||
use crate::Error;
|
||||
|
||||
@@ -89,11 +92,13 @@ where
|
||||
<C as Group>::ScalarField: Absorb,
|
||||
{
|
||||
pub fn new(w: Vec<C::ScalarField>, e_len: usize) -> Self {
|
||||
// note: at the current version, we don't use the blinding factors and we set them to 0
|
||||
// always.
|
||||
Self {
|
||||
E: vec![C::ScalarField::zero(); e_len],
|
||||
rE: C::ScalarField::zero(), // because we use C::zero() as cmE
|
||||
rE: C::ScalarField::zero(),
|
||||
W: w,
|
||||
rW: C::ScalarField::one(),
|
||||
rW: C::ScalarField::zero(),
|
||||
}
|
||||
}
|
||||
pub fn commit(
|
||||
|
||||
Reference in New Issue
Block a user