Type Alias ParamsVerifierKZG

Source
pub type ParamsVerifierKZG<C> = ParamsKZG<C>;
Expand description

KZG multi-open verification parameters

Aliased Type§

struct ParamsVerifierKZG<C> { /* private fields */ }

Implementations

Source§

impl<E: Engine + Debug> ParamsKZG<E>

Source

pub fn setup<R: RngCore>(k: u32, rng: R) -> Self

Initializes parameters for the curve, draws toxic secret from given rng. MUST NOT be used in production.

Source

pub fn from_parts( &self, k: u32, g: Vec<E::G1Affine>, g_lagrange: Option<Vec<E::G1Affine>>, g2: E::G2Affine, s_g2: E::G2Affine, ) -> Self

Initializes parameters for the curve through existing parameters k, g, g_lagrange (optional), g2, s_g2

Source

pub fn g2(&self) -> E::G2Affine

Returns gernerator on G2

Source

pub fn s_g2(&self) -> E::G2Affine

Returns first power of secret on G2

Source

pub fn write_custom<W: Write>( &self, writer: &mut W, format: SerdeFormat, ) -> Result<()>
where E::G1Affine: SerdeCurveAffine, E::G2Affine: SerdeCurveAffine,

Writes parameters to buffer

Source

pub fn read_custom<R: Read>(reader: &mut R, format: SerdeFormat) -> Result<Self>
where E::G1Affine: SerdeCurveAffine, E::G2Affine: SerdeCurveAffine,

Reads params from a buffer.

Trait Implementations

Source§

impl<E: Clone + Engine> Clone for ParamsKZG<E>
where E::G1Affine: Clone, E::G2Affine: Clone,

Source§

fn clone(&self) -> ParamsKZG<E>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: Debug + Engine> Debug for ParamsKZG<E>
where E::G1Affine: Debug, E::G2Affine: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'params, E: Engine + Debug> Params<'params, <E as Engine>::G1Affine> for ParamsKZG<E>
where E::G1Affine: SerdeCurveAffine<ScalarExt = E::Fr, CurveExt = E::G1>, E::G2Affine: SerdeCurveAffine,

Source§

fn write<W: Write>(&self, writer: &mut W) -> Result<()>

Writes params to a buffer.

Source§

fn read<R: Read>(reader: &mut R) -> Result<Self>

Reads params from a buffer.

Source§

type MSM = MSMKZG<E>

Multi scalar multiplication engine
Source§

fn k(&self) -> u32

Logaritmic size of the circuit
Source§

fn n(&self) -> u64

Size of the circuit
Source§

fn downsize(&mut self, k: u32)

Downsize Params with smaller k.
Source§

fn empty_msm(&'params self) -> MSMKZG<E>

Generates an empty multiscalar multiplication struct using the appropriate params.
Source§

fn commit_lagrange( &self, poly: &Polynomial<E::Fr, LagrangeCoeff>, _: Blind<E::Fr>, ) -> E::G1

This commits to a polynomial using its evaluations over the $2^k$ size evaluation domain. The commitment will be blinded by the blinding factor r.
Source§

impl<'params, E: Engine + Debug> ParamsProver<'params, <E as Engine>::G1Affine> for ParamsKZG<E>
where E::G1Affine: SerdeCurveAffine<ScalarExt = E::Fr, CurveExt = E::G1>, E::G2Affine: SerdeCurveAffine,

Source§

type ParamsVerifier = ParamsKZG<E>

Constant verifier parameters.
Source§

fn verifier_params(&'params self) -> &'params Self::ParamsVerifier

Returns verification parameters.
Source§

fn new(k: u32) -> Self

Returns new instance of parameters
Source§

fn commit(&self, poly: &Polynomial<E::Fr, Coeff>, _: Blind<E::Fr>) -> E::G1

This computes a commitment to a polynomial described by the provided slice of coefficients. The commitment may be blinded by the blinding factor r.
Source§

fn get_g(&self) -> &[E::G1Affine]

Getter for g generators
Source§

impl<'params, E: Engine + Debug> ParamsVerifier<'params, <E as Engine>::G1Affine> for ParamsKZG<E>
where E::G1Affine: SerdeCurveAffine<ScalarExt = E::Fr, CurveExt = E::G1>, E::G2Affine: SerdeCurveAffine,