pub struct StarknetCurveConfig;Expand description
The Stark curve in the arkworks short Weierstrass curve representation
Trait Implementations§
Source§impl CurveConfig for StarknetCurveConfig
impl CurveConfig for StarknetCurveConfig
Source§const COFACTOR: &'static [u64]
const COFACTOR: &'static [u64]
The cofactor of this curve, represented as a sequence of little-endian limbs.
const COFACTOR_INV: Self::ScalarField
Source§type BaseField = Fp<MontBackend<StarknetFqConfig, 4>, 4>
type BaseField = Fp<MontBackend<StarknetFqConfig, 4>, 4>
Base field that the curve is defined over.
Source§type ScalarField = Fp<MontBackend<StarknetFrConfig, 4>, 4>
type ScalarField = Fp<MontBackend<StarknetFrConfig, 4>, 4>
Finite prime field corresponding to an appropriate prime-order subgroup
of the curve group.
fn cofactor_is_one() -> bool
Source§impl SWCurveConfig for StarknetCurveConfig
See https://docs.starkware.co/starkex/crypto/stark-curve.html
for curve parameters
impl SWCurveConfig for StarknetCurveConfig
See https://docs.starkware.co/starkex/crypto/stark-curve.html for curve parameters
Source§fn mul_by_a(elem: Self::BaseField) -> Self::BaseField
fn mul_by_a(elem: Self::BaseField) -> Self::BaseField
Helper method for computing
elem * Self::COEFF_A. Read moreSource§fn add_b(elem: Self::BaseField) -> Self::BaseField
fn add_b(elem: Self::BaseField) -> Self::BaseField
Helper method for computing
elem + Self::COEFF_B. Read moreSource§fn is_in_correct_subgroup_assuming_on_curve(item: &Affine<Self>) -> bool
fn is_in_correct_subgroup_assuming_on_curve(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>
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: &[u64]) -> Projective<Self>
fn mul_projective(base: &Projective<Self>, scalar: &[u64]) -> Projective<Self>
Default implementation of group multiplication for projective
coordinates
Source§fn mul_affine(base: &Affine<Self>, scalar: &[u64]) -> Projective<Self>
fn mul_affine(base: &Affine<Self>, scalar: &[u64]) -> Projective<Self>
Default implementation of group multiplication for affine
coordinates.
Source§fn msm(
bases: &[Affine<Self>],
scalars: &[Self::ScalarField],
) -> Result<Projective<Self>, usize>
fn msm( bases: &[Affine<Self>], scalars: &[Self::ScalarField], ) -> Result<Projective<Self>, usize>
Default implementation for multi scalar multiplication
Source§fn serialize_with_mode<W>(
item: &Affine<Self>,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>where
W: Write,
fn serialize_with_mode<W>(
item: &Affine<Self>,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>where
W: Write,
If uncompressed, serializes both x and y coordinates as well as a bit for whether it is
infinity. If compressed, serializes x coordinate with two bits to encode whether y is
positive, negative, or infinity.
Source§fn deserialize_with_mode<R>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<Affine<Self>, SerializationError>where
R: Read,
fn deserialize_with_mode<R>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<Affine<Self>, SerializationError>where
R: Read,
If
validate is Yes, calls check() to make sure the element is valid.fn serialized_size(compress: Compress) -> usize
Source§impl SWUConfig for StarknetCurveConfig
Defines the \zeta constant for the SWU map to curve implementation
impl SWUConfig for StarknetCurveConfig
Defines the \zeta constant for the SWU map to curve implementation
Auto Trait Implementations§
impl Freeze for StarknetCurveConfig
impl RefUnwindSafe for StarknetCurveConfig
impl Send for StarknetCurveConfig
impl Sync for StarknetCurveConfig
impl Unpin for StarknetCurveConfig
impl UnwindSafe for StarknetCurveConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more