Struct ark_ed_on_bls12_381::JubjubParameters
source · pub struct JubjubParameters;
Expand description
JubJub
is a twisted Edwards curve. These curves have equations of the
form: ax² + y² = 1 - dx²y².
over some base finite field Fq.
JubJub’s curve equation: -x² + y² = 1 - (10240/10241)x²y²
q = 52435875175126190479447740508185965837690552500527637822603658699938581184513.
a = -1. d = -(10240/10241) mod q = 19257038036680949359750312669786877991949435402254120286184196891950884077233.
Sage script to calculate these:
q = 52435875175126190479447740508185965837690552500527637822603658699938581184513
Fq = GF(q)
d = -(Fq(10240)/Fq(10241))
These parameters and the sage script obtained from: https://github.com/zcash/zcash/issues/2230#issuecomment-317182190
jubjub
also has a short Weierstrass curve form, following the
form: y² = x³ + A * x + B
where
A = 52296097456646850916096512823759002727550416093741407922227928430486925478210 B = 48351165704696163914533707656614864561753505123260775585269522553028192119009
We can use the script available here to convert between the different representations.
Trait Implementations§
source§impl Clone for JubjubParameters
impl Clone for JubjubParameters
source§fn clone(&self) -> JubjubParameters
fn clone(&self) -> JubjubParameters
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl CurveConfig for JubjubParameters
impl CurveConfig for JubjubParameters
source§const COFACTOR_INV: Fr = _
const COFACTOR_INV: Fr = _
COFACTOR^(-1) mod r = 819310549611346726241370945440405716213240158234039660170669895299022906775
§type BaseField = Fp<MontBackend<FrConfig, 4>, 4>
type BaseField = Fp<MontBackend<FrConfig, 4>, 4>
§type ScalarField = Fp<MontBackend<FrConfig, 4>, 4>
type ScalarField = Fp<MontBackend<FrConfig, 4>, 4>
fn cofactor_is_one() -> bool
source§impl Default for JubjubParameters
impl Default for JubjubParameters
source§fn default() -> JubjubParameters
fn default() -> JubjubParameters
source§impl MontCurveConfig for JubjubParameters
impl MontCurveConfig for JubjubParameters
source§impl PartialEq<JubjubParameters> for JubjubParameters
impl PartialEq<JubjubParameters> for JubjubParameters
source§fn eq(&self, other: &JubjubParameters) -> bool
fn eq(&self, other: &JubjubParameters) -> bool
source§impl SWCurveConfig for JubjubParameters
impl SWCurveConfig for JubjubParameters
source§const COEFF_A: Self::BaseField = _
const COEFF_A: Self::BaseField = _
COEFF_A = 52296097456646850916096512823759002727550416093741407922227928430486925478210
source§const COEFF_B: Self::BaseField = _
const COEFF_B: Self::BaseField = _
COEFF_B = 48351165704696163914533707656614864561753505123260775585269522553028192119009
source§fn mul_by_a(elem: Self::BaseField) -> Self::BaseField
fn mul_by_a(elem: Self::BaseField) -> Self::BaseField
elem * Self::COEFF_A
. Read moresource§fn add_b(elem: Self::BaseField) -> Self::BaseField
fn add_b(elem: Self::BaseField) -> Self::BaseField
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
source§fn clear_cofactor(item: &Affine<Self>) -> Affine<Self>
fn clear_cofactor(item: &Affine<Self>) -> Affine<Self>
source§fn mul_projective(base: &Projective<Self>, scalar: &[u64]) -> Projective<Self>
fn mul_projective(base: &Projective<Self>, scalar: &[u64]) -> Projective<Self>
source§fn mul_affine(base: &Affine<Self>, scalar: &[u64]) -> Projective<Self>
fn mul_affine(base: &Affine<Self>, scalar: &[u64]) -> Projective<Self>
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,
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,
validate
is Yes
, calls check()
to make sure the element is valid.fn serialized_size(compress: Compress) -> usize
source§impl TECurveConfig for JubjubParameters
impl TECurveConfig for JubjubParameters
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
Multiplication by a
is simply negation here.