CurveConfig

Trait CurveConfig 

Source
pub trait CurveConfig:
    Send
    + Sync
    + Sized
    + 'static {
    type BaseField: Field;
    type ScalarField: PrimeField;

    const COFACTOR: &'static [u64];
    const COFACTOR_INV: Self::ScalarField;

    // Provided method
    fn cofactor_is_one() -> bool { ... }
}
Expand description

Elliptic curves can be represented via different “models” with varying efficiency properties.

CurveConfig bundles together the types that are common to all models of the given curve, namely the Self::BaseField over which the curve is defined, and the Self::ScalarField defined by the appropriate prime-order subgroup of the curve.

Required Associated Constants§

Source

const COFACTOR: &'static [u64]

The cofactor of this curve, represented as a sequence of little-endian limbs.

Source

const COFACTOR_INV: Self::ScalarField

The inverse of the cofactor.

Required Associated Types§

Source

type BaseField: Field

Base field that the curve is defined over.

Source

type ScalarField: PrimeField

Finite prime field corresponding to an appropriate prime-order subgroup of the curve group.

Provided Methods§

Source

fn cofactor_is_one() -> bool

Returns true if the cofactor is one.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl CurveConfig for Secp256k1Config

Source§

const COFACTOR: &'static [u64]

Source§

const COFACTOR_INV: Fr = Fr::ONE

Source§

type BaseField = Fp<Secp256k1FqParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

type ScalarField = Fp<Secp256k1FrParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

impl CurveConfig for StarknetCurveConfig

Source§

const COFACTOR: &'static [u64]

Source§

const COFACTOR_INV: Fr = Fr::ONE

Source§

type BaseField = Fp<StarknetFqParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

type ScalarField = Fp<StarknetFrParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

impl CurveConfig for BabyJubjubConfig

Source§

const COFACTOR: &'static [u64]

Source§

const COFACTOR_INV: Fr

Source§

type BaseField = Fp<BabyJubjubFqParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

type ScalarField = Fp<BabyJubjubFrParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

impl CurveConfig for BandersnatchConfig

Source§

const COFACTOR: &'static [u64]

Source§

const COFACTOR_INV: Fr

Source§

type BaseField = Fp<BandersnatchFqParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

type ScalarField = Fp<BandersnatchFrParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

impl CurveConfig for Curve25519Config

Source§

const COFACTOR: &'static [u64]

Source§

const COFACTOR_INV: Fr

Source§

type BaseField = Fp<Curve25519FqParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

type ScalarField = Fp<Curve25519FrParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

impl CurveConfig for JubjubConfig

Source§

const COFACTOR: &'static [u64]

Source§

const COFACTOR_INV: Fr

Source§

type BaseField = Fp<JubjubFqParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>

Source§

type ScalarField = Fp<JubjubFrParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>