Type Alias Halo2Params

Source
pub type Halo2Params = ParamsKZG<Bn256>;

Aliased Type§

struct Halo2Params { /* private fields */ }

Implementations

Source§

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

Source

pub fn setup<R>(k: u32, rng: R) -> ParamsKZG<E>
where R: RngCore,

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 as Engine>::G1Affine>, g_lagrange: Option<Vec<<E as Engine>::G1Affine>>, g2: <E as Engine>::G2Affine, s_g2: <E as Engine>::G2Affine, ) -> ParamsKZG<E>

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

Source

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

Returns gernerator on G2

Source

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

Returns first power of secret on G2

Source

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

Writes parameters to buffer

Source

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

Reads params from a buffer.

Trait Implementations

Source§

impl<E> Clone for ParamsKZG<E>
where E: Clone + Engine, <E as Engine>::G1Affine: Clone, <E as Engine>::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 for ParamsKZG<E>
where E: Debug + Engine, <E as Engine>::G1Affine: Debug, <E as Engine>::G2Affine: Debug,

Source§

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

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

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

Source§

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

Writes params to a buffer.

Source§

fn read<R>(reader: &mut R) -> Result<ParamsKZG<E>, Error>
where R: Read,

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 as Engine>::Fr, LagrangeCoeff>, _: Blind<<E as Engine>::Fr>, ) -> <E as Engine>::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> ParamsProver<'params, <E as Engine>::G1Affine> for ParamsKZG<E>
where E: Debug + Engine, <E as Engine>::G1Affine: SerdeCurveAffine<ScalarExt = <E as Engine>::Fr, CurveExt = <E as Engine>::G1>, <E as Engine>::G2Affine: SerdeCurveAffine,

Source§

type ParamsVerifier = ParamsKZG<E>

Constant verifier parameters.
Source§

fn verifier_params( &'params self, ) -> &'params <ParamsKZG<E> as ParamsProver<'params, <E as Engine>::G1Affine>>::ParamsVerifier

Returns verification parameters.
Source§

fn new(k: u32) -> ParamsKZG<E>

Returns new instance of parameters
Source§

fn commit( &self, poly: &Polynomial<<E as Engine>::Fr, Coeff>, _: Blind<<E as Engine>::Fr>, ) -> <E as Engine>::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 as Engine>::G1Affine]

Getter for g generators
Source§

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