pub struct Parameters;Trait Implementations§
Source§impl Clone for Parameters
impl Clone for Parameters
Source§fn clone(&self) -> Parameters
fn clone(&self) -> Parameters
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CurveConfig for Parameters
impl CurveConfig for Parameters
Source§const COFACTOR: &'static [u64]
const COFACTOR: &'static [u64]
COFACTOR = (x - 1)^2 / 3 = 30631250834960419227450344600217059328
Source§const COFACTOR_INV: Fp<MontBackend<FrConfig, 4>, 4>
const COFACTOR_INV: Fp<MontBackend<FrConfig, 4>, 4>
COFACTOR_INV = COFACTOR^{-1} mod r = 5285428838741532253824584287042945485047145357130994810877
Source§type ScalarField = Fp<MontBackend<FrConfig, 4>, 4>
type ScalarField = Fp<MontBackend<FrConfig, 4>, 4>
fn cofactor_is_one() -> bool
Source§impl Default for Parameters
impl Default for Parameters
Source§fn default() -> Parameters
fn default() -> Parameters
Source§impl MontCurveConfig for Parameters
impl MontCurveConfig for Parameters
Source§const COEFF_A: Fp<MontBackend<FqConfig, 6>, 6>
const COEFF_A: Fp<MontBackend<FqConfig, 6>, 6>
COEFF_A = 228097355113300204138531148905234651262148041026195375645000724271212049151994375092458297304264351187709081232384
Source§const COEFF_B: Fp<MontBackend<FqConfig, 6>, 6>
const COEFF_B: Fp<MontBackend<FqConfig, 6>, 6>
COEFF_B = 10189023633222963290707194929886294091415157242906428298294512798502806398782149227503530278436336312243746741931
Source§type TECurveConfig = Parameters
type TECurveConfig = Parameters
Source§impl PartialEq for Parameters
impl PartialEq for Parameters
Source§impl SWCurveConfig for Parameters
impl SWCurveConfig for Parameters
Source§const GENERATOR: Affine<Parameters>
const GENERATOR: Affine<Parameters>
AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
Source§fn mul_by_a(
_: <Parameters as CurveConfig>::BaseField,
) -> <Parameters as CurveConfig>::BaseField
fn mul_by_a( _: <Parameters as CurveConfig>::BaseField, ) -> <Parameters as CurveConfig>::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 Parameters
Bls12_377::G1 also has a twisted Edwards form.
It can be obtained via the following script, implementing
impl TECurveConfig for Parameters
Bls12_377::G1 also has a twisted Edwards form. It can be obtained via the following script, implementing
- SW -> Montgomery -> TE1 transformation: https://en.wikipedia.org/wiki/Montgomery_curve
- TE1 -> TE2 normalization (enforcing
a = -1)
# modulus
p = 0x1ae3a4617c510eac63b05c06ca1493b1a22d9f300f5138f1ef3622fba094800170b5d44300000008508c00000000001
Fp = Zmod(p)
#####################################################
# Weierstrass curve: y² = x³ + A * x + B
#####################################################
# curve y^2 = x^3 + 1
WA = Fp(0)
WB = Fp(1)
#####################################################
# Montgomery curve: By² = x³ + A * x² + x
#####################################################
# root for x^3 + 1 = 0
alpha = -1
# s = 1 / (sqrt(3alpha^2 + a))
s = 1/(Fp(3).sqrt())
# MA = 3 * alpha * s
MA = Fp(228097355113300204138531148905234651262148041026195375645000724271212049151994375092458297304264351187709081232384)
# MB = s
MB = Fp(10189023633222963290707194929886294091415157242906428298294512798502806398782149227503530278436336312243746741931)
# #####################################################
# # Twisted Edwards curve 1: a * x² + y² = 1 + d * x² * y²
# #####################################################
# We first convert to TE form obtaining a curve with a != -1, and then
# apply a transformation to obtain a TE curve with a = -1.
# a = (MA+2)/MB
TE1a = Fp(61134141799337779744243169579317764548490943457438569789767076791016838392692895365021181670618017873462480451583)
# b = (MA-2)/MB
TE1d = Fp(197530284213631314266409564115575768987902569297476090750117185875703629955647927409947706468955342250977841006588)
# #####################################################
# # Twisted Edwards curve 2: a * x² + y² = 1 + d * x² * y²
# #####################################################
# a = -1
TE2a = Fp(-1)
# b = -TE1d/TE1a
TE2d = Fp(122268283598675559488486339158635529096981886914877139579534153582033676785385790730042363341236035746924960903179)Source§const COEFF_D: Fp<MontBackend<FqConfig, 6>, 6>
const COEFF_D: Fp<MontBackend<FqConfig, 6>, 6>
COEFF_D = 122268283598675559488486339158635529096981886914877139579534153582033676785385790730042363341236035746924960903179 mod q
Source§const GENERATOR: Affine<Parameters>
const GENERATOR: Affine<Parameters>
AFFINE_GENERATOR_COEFFS = (GENERATOR_X, GENERATOR_Y)
Source§fn mul_by_a(
elem: <Parameters as CurveConfig>::BaseField,
) -> <Parameters as CurveConfig>::BaseField
fn mul_by_a( elem: <Parameters as CurveConfig>::BaseField, ) -> <Parameters as CurveConfig>::BaseField
Multiplication by a is multiply by -1.
Source§type MontCurveConfig = Parameters
type MontCurveConfig = Parameters
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
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,
fn serialized_size(compress: Compress) -> usize
impl Eq for Parameters
impl StructuralPartialEq for Parameters
Auto Trait Implementations§
impl Freeze for Parameters
impl RefUnwindSafe for Parameters
impl Send for Parameters
impl Sync for Parameters
impl Unpin for Parameters
impl UnwindSafe for Parameters
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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