StarknetCurveConfig

Struct StarknetCurveConfig 

Source
pub struct StarknetCurveConfig;
Expand description

Starknet’s Curve Details.

Trait Implementations§

Source§

impl Clone for StarknetCurveConfig

Source§

fn clone(&self) -> StarknetCurveConfig

Returns a duplicate 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 CurveConfig for StarknetCurveConfig

Source§

const COFACTOR: &'static [u64]

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

const COFACTOR_INV: Fr = Fr::ONE

The inverse of the cofactor.
Source§

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

Base field that the curve is defined over.
Source§

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

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

fn cofactor_is_one() -> bool

Returns true if the cofactor is one.
Source§

impl Default for StarknetCurveConfig

Source§

fn default() -> StarknetCurveConfig

Returns the “default value” for a type. Read more
Source§

impl PartialEq for StarknetCurveConfig

Source§

fn eq(&self, other: &StarknetCurveConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PedersenParams<StarknetCurveConfig> for StarknetPedersenParams

Source§

const LOW_PART_BITS: u32 = 248u32

Low part bits.

Source§

const LOW_PART_MASK: U256

Low part mask. (2**248 - 1)

Source§

const N_ELEMENT_BITS_HASH: usize = 252usize

Number of elements in the hash.
Source§

const P_0: Affine<StarknetCurveConfig>

Shift point.
Source§

const P_1: Affine<StarknetCurveConfig>

Constant point – P_1.
Source§

const P_2: Affine<StarknetCurveConfig>

Constant point – P_2.
Source§

const P_3: Affine<StarknetCurveConfig>

Constant point – P_3.
Source§

const P_4: Affine<StarknetCurveConfig>

Constant point – P_4.
Source§

type AffineRepr = Affine<StarknetCurveConfig>

The affine representation type for this Elliptic Curve.
Source§

impl SWCurveConfig for StarknetCurveConfig

Source§

const COEFF_A: Fq

Coefficient a of the curve equation.
Source§

const COEFF_B: Fq

Coefficient b of the curve equation.
Source§

const GENERATOR: Affine<StarknetCurveConfig>

Generator of the prime-order subgroup.
Source§

fn mul_by_a(elem: Self::BaseField) -> Self::BaseField

Helper method for computing elem * Self::COEFF_A. Read more
Source§

fn add_b(elem: Self::BaseField) -> Self::BaseField

Helper method for computing elem + Self::COEFF_B. Read more
Source§

fn is_in_prime_order_subgroup(item: &Affine<Self>) -> bool

Check if the provided curve point is in the prime-order subgroup. Read more
Source§

fn clear_cofactor(item: &Affine<Self>) -> Affine<Self>

Performs cofactor clearing. The default method is simply to multiply by the cofactor. Some curves can implement a more efficient algorithm.
Source§

fn mul_projective( base: &Projective<Self>, scalar: impl BitIteratorBE, ) -> Projective<Self>

Default implementation of group multiplication for projective coordinates.
Source§

fn mul_affine( base: &Affine<Self>, scalar: impl BitIteratorBE, ) -> Projective<Self>

Default implementation of group multiplication for affine coordinates.
Source§

impl Eq for StarknetCurveConfig

Source§

impl StructuralPartialEq for StarknetCurveConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.