pub trait ArrabbiataCurve: CommitmentCurve + EndoCurvewhere
    Self::BaseField: PrimeField,{
    type SpongeConstants: SpongeConstants;

    const NAME: &'static str;
    const SPONGE_CONSTANTS: Self::SpongeConstants;

    // Required methods
    fn sponge_params() -> &'static ArithmeticSpongeParams<Self::ScalarField>;
    fn other_curve_sponge_params(
    ) -> &'static ArithmeticSpongeParams<Self::BaseField>;
    fn endos() -> &'static (Self::BaseField, Self::ScalarField);
    fn other_curve_endo() -> &'static Self::ScalarField;
    fn get_curve_params() -> (Self::BaseField, Self::BaseField);
    fn create_new_sponge(
    ) -> DefaultFqSponge<Self::Params, Self::SpongeConstants>;
    fn absorb_fq(
        sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants>,
        fq: Self::BaseField
    );
    fn absorb_curve_points(
        sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants>,
        comms: &[Self]
    );
    fn squeeze_challenge(
        sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants>
    ) -> Self::ScalarField;
}
Expand description

Represents additional information that a curve needs in order to be used with Arrabbiata.

The trait [CommitmentCurve] enforces the curve to be given in short Weierstrass form.

Required Associated Types§

source

type SpongeConstants: SpongeConstants

Required Associated Constants§

source

const NAME: &'static str

A human readable name.

source

const SPONGE_CONSTANTS: Self::SpongeConstants

Required Methods§

source

fn sponge_params() -> &'static ArithmeticSpongeParams<Self::ScalarField>

Provides the sponge params to be used with this curve.

source

fn other_curve_sponge_params( ) -> &'static ArithmeticSpongeParams<Self::BaseField>

Provides the sponge params to be used with the other curve.

source

fn endos() -> &'static (Self::BaseField, Self::ScalarField)

Provides the coefficients for the curve endomorphism, called (q,r) in some places.

source

fn other_curve_endo() -> &'static Self::ScalarField

Provides the coefficient for the curve endomorphism over the other field, called q in some places.

source

fn get_curve_params() -> (Self::BaseField, Self::BaseField)

Return the coefficients a and b of the equation y^2 = x^3 + a x + b defining the curve.

source

fn create_new_sponge() -> DefaultFqSponge<Self::Params, Self::SpongeConstants>

Create a new sponge, with an empty state (i.e. initialized to zero).

source

fn absorb_fq( sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants>, fq: Self::BaseField )

Absorb an element of the base field into the sponge.

This method is supposed to be an alias to sponge.absorb_fq(&[fq]). However, it seems that the compiler requests some additional type constraints if there is generic code over the trait ArrabbiataCurve.

source

fn absorb_curve_points( sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants>, comms: &[Self] )

Absorb a list of curve points into the sponge.

This method is supposed to be an alias to sponge.absorb_g(&[gs]). However, it seems that the compiler requests some additional type constraints if there is generic code over the trait ArrabbiataCurve.

source

fn squeeze_challenge( sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants> ) -> Self::ScalarField

Coin a challenge from the sponge. Note that a challenge set might not be covering the whole set the scalar field is defined on.

In particular, for the Pasta curves, a 128-bits value is expected as an output.

This method is supposed to be an alias to sponge.challenge(). However, it seems that the compiler requests some additional type constraints if there is generic code over the trait ArrabbiataCurve.

Implementations on Foreign Types§

source§

impl ArrabbiataCurve for Affine<PallasParameters>

source§

const NAME: &'static str = "pallas"

§

type SpongeConstants = PlonkSpongeConstants

source§

const SPONGE_CONSTANTS: Self::SpongeConstants = _

source§

fn sponge_params() -> &'static ArithmeticSpongeParams<Self::ScalarField>

source§

fn other_curve_sponge_params( ) -> &'static ArithmeticSpongeParams<Self::BaseField>

source§

fn endos() -> &'static (Self::BaseField, Self::ScalarField)

source§

fn other_curve_endo() -> &'static Self::ScalarField

source§

fn get_curve_params() -> (Self::BaseField, Self::BaseField)

source§

fn create_new_sponge() -> DefaultFqSponge<Self::Params, Self::SpongeConstants>

source§

fn absorb_fq( sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants>, fq: Self::BaseField )

source§

fn absorb_curve_points( sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants>, comms: &[Self] )

source§

fn squeeze_challenge( sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants> ) -> Self::ScalarField

source§

impl ArrabbiataCurve for Affine<VestaParameters>

source§

const NAME: &'static str = "vesta"

§

type SpongeConstants = PlonkSpongeConstants

source§

const SPONGE_CONSTANTS: Self::SpongeConstants = _

source§

fn sponge_params() -> &'static ArithmeticSpongeParams<Self::ScalarField>

source§

fn other_curve_sponge_params( ) -> &'static ArithmeticSpongeParams<Self::BaseField>

source§

fn endos() -> &'static (Self::BaseField, Self::ScalarField)

source§

fn other_curve_endo() -> &'static Self::ScalarField

source§

fn get_curve_params() -> (Self::BaseField, Self::BaseField)

source§

fn create_new_sponge() -> DefaultFqSponge<Self::Params, Self::SpongeConstants>

source§

fn absorb_fq( sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants>, fq: Self::BaseField )

source§

fn absorb_curve_points( sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants>, comms: &[Self] )

source§

fn squeeze_challenge( sponge: &mut DefaultFqSponge<Self::Params, Self::SpongeConstants> ) -> Self::ScalarField

Implementors§