Struct snarkvm_polycommit::kzg10::KZG10
source · [−]pub struct KZG10<E: PairingEngine>(_);
Expand description
KZG10
is an implementation of the polynomial commitment scheme of
Kate, Zaverucha and Goldbgerg
Implementations
sourceimpl<E: PairingEngine> KZG10<E>
impl<E: PairingEngine> KZG10<E>
sourcepub fn setup<R: RngCore>(
max_degree: usize,
supported_degree_bounds_config: &KZG10DegreeBoundsConfig,
produce_g2_powers: bool,
rng: &mut R
) -> Result<UniversalParams<E>, Error>
pub fn setup<R: RngCore>(
max_degree: usize,
supported_degree_bounds_config: &KZG10DegreeBoundsConfig,
produce_g2_powers: bool,
rng: &mut R
) -> Result<UniversalParams<E>, Error>
Constructs public parameters when given as input the maximum degree degree
for the polynomial commitment scheme.
sourcepub fn commit(
powers: &Powers<'_, E>,
polynomial: &Polynomial<E::Fr>,
hiding_bound: Option<usize>,
terminator: &AtomicBool,
rng: Option<&mut dyn RngCore>
) -> Result<(Commitment<E>, Randomness<E>), Error>
pub fn commit(
powers: &Powers<'_, E>,
polynomial: &Polynomial<E::Fr>,
hiding_bound: Option<usize>,
terminator: &AtomicBool,
rng: Option<&mut dyn RngCore>
) -> Result<(Commitment<E>, Randomness<E>), Error>
Outputs a commitment to polynomial
.
sourcepub fn compute_witness_polynomial(
polynomial: &Polynomial<E::Fr>,
point: E::Fr,
randomness: &Randomness<E>
) -> Result<(Polynomial<E::Fr>, Option<Polynomial<E::Fr>>), Error>
pub fn compute_witness_polynomial(
polynomial: &Polynomial<E::Fr>,
point: E::Fr,
randomness: &Randomness<E>
) -> Result<(Polynomial<E::Fr>, Option<Polynomial<E::Fr>>), Error>
Compute witness polynomial.
The witness polynomial w(x) the quotient of the division (p(x) - p(z)) / (x - z) Observe that this quotient does not change with z because p(z) is the remainder term. We can therefore omit p(z) when computing the quotient.
sourcepub fn check(
vk: &VerifierKey<E>,
commitment: &Commitment<E>,
point: E::Fr,
value: E::Fr,
proof: &Proof<E>
) -> Result<bool, Error>
pub fn check(
vk: &VerifierKey<E>,
commitment: &Commitment<E>,
point: E::Fr,
value: E::Fr,
proof: &Proof<E>
) -> Result<bool, Error>
Verifies that value
is the evaluation at point
of the polynomial
committed inside commitment
.
Trait Implementations
sourceimpl<E: Clone + PairingEngine> Clone for KZG10<E>
impl<E: Clone + PairingEngine> Clone for KZG10<E>
Auto Trait Implementations
impl<E> RefUnwindSafe for KZG10<E> where
E: RefUnwindSafe,
impl<E> Send for KZG10<E>
impl<E> Sync for KZG10<E>
impl<E> Unpin for KZG10<E> where
E: Unpin,
impl<E> UnwindSafe for KZG10<E> where
E: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more