Struct ark_ed_on_bn254::EdwardsConfig
source · pub struct EdwardsConfig;
Expand description
Baby-JubJub
is a twisted Edwards curve. These curves have equations of the
form: ax² + y² = 1 + dx²y².
over some base finite field Fq.
Baby-JubJub’s curve equation: x² + y² = 1 + (168696/168700)x²y²
q = 21888242871839275222246405745257275088548364400416034343698204186575808495617
Trait Implementations§
source§impl Clone for EdwardsConfig
impl Clone for EdwardsConfig
source§fn clone(&self) -> EdwardsConfig
fn clone(&self) -> EdwardsConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CurveConfig for EdwardsConfig
impl CurveConfig for EdwardsConfig
source§const COFACTOR_INV: Fr = _
const COFACTOR_INV: Fr = _
COFACTOR^(-1) mod r = 2394026564107420727433200628387514462817212225638746351800188703329891451411
§type BaseField = Fp<MontBackend<FrConfig, 4>, 4>
type BaseField = Fp<MontBackend<FrConfig, 4>, 4>
Base field that the curve is defined over.
§type ScalarField = Fp<MontBackend<FrConfig, 4>, 4>
type ScalarField = Fp<MontBackend<FrConfig, 4>, 4>
Finite prime field corresponding to an appropriate prime-order subgroup
of the curve group.
fn cofactor_is_one() -> bool
source§impl Default for EdwardsConfig
impl Default for EdwardsConfig
source§fn default() -> EdwardsConfig
fn default() -> EdwardsConfig
Returns the “default value” for a type. Read more
source§impl MontCurveConfig for EdwardsConfig
impl MontCurveConfig for EdwardsConfig
source§impl PartialEq<EdwardsConfig> for EdwardsConfig
impl PartialEq<EdwardsConfig> for EdwardsConfig
source§fn eq(&self, other: &EdwardsConfig) -> bool
fn eq(&self, other: &EdwardsConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TECurveConfig for EdwardsConfig
impl TECurveConfig for EdwardsConfig
source§const COEFF_D: Fq = _
const COEFF_D: Fq = _
COEFF_D = 168696/168700 mod q = 9706598848417545097372247223557719406784115219466060233080913168975159366771
source§const GENERATOR: EdwardsAffine = _
const GENERATOR: EdwardsAffine = _
AFFINE_GENERATOR_COEFFS = (GENERATOR_X, GENERATOR_Y)
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 more§type MontCurveConfig = EdwardsConfig
type MontCurveConfig = EdwardsConfig
Model parameters for the Montgomery curve that is birationally
equivalent to this curve.
source§fn is_in_correct_subgroup_assuming_on_curve(item: &Affine<Self>) -> bool
fn is_in_correct_subgroup_assuming_on_curve(item: &Affine<Self>) -> bool
Checks that the current point is in the prime order subgroup given
the point on the curve.
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.
For some curve families though, it is sufficient to multiply
by a smaller scalar.
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.
If compressed, serializes y coordinate with a bit to encode whether x is positive.
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,
fn serialized_size(compress: Compress) -> usize
impl Eq for EdwardsConfig
impl StructuralEq for EdwardsConfig
impl StructuralPartialEq for EdwardsConfig
Auto Trait Implementations§
impl RefUnwindSafe for EdwardsConfig
impl Send for EdwardsConfig
impl Sync for EdwardsConfig
impl Unpin for EdwardsConfig
impl UnwindSafe for EdwardsConfig
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more