Crate midnight_curves

Crate midnight_curves 

Source
Expand description

§blstrs

An implementation of the BLS12-381 pairing-friendly elliptic curve construction.

Re-exports§

pub use bls12_381::unique_messages;
pub use bls12_381::Bls12;
pub use bls12_381::Fp;
pub use bls12_381::Fq;
pub use bls12_381::G1Affine;
pub use bls12_381::G1Projective;
pub use bls12_381::G2Affine;
pub use bls12_381::G2Prepared;
pub use bls12_381::G2Projective;
pub use bls12_381::Gt;
pub use bls12_381::MillerLoopResult;
pub use bls12_381::PairingG1G2;
pub use bls12_381::PairingG2G1;
pub use bls12_381::A;
pub use bls12_381::B;
pub use crate::Fq as BlsScalar;
pub use crate::Fr;
pub use pairing;

Modules§

bls12_381
BLS12-381 pairing-friendly elliptic curve implementation.
ff_ext
Field extension traits and utilities.
fft
hash_to_curve
msm
secp256k1
Secp256k1 elliptic curve implementation.
serde
serde_traits
Serialization traits for curve elements and field elements.

Macros§

extend_field_legendre
field_bits
impl_add_binop_specify_output
impl_binops_additive
impl_binops_additive_specify_output
impl_binops_calls
impl_binops_multiplicative
impl_binops_multiplicative_mixed
impl_cyclotomic_square
impl_from_bool
impl_from_u64
impl_gt
impl_miller_loop_components
impl_sub_binop_specify_output
impl_sum_prod
impl_tower2
impl_tower2_from_uniform_bytes
new_curve_impl
serialize_deserialize_primefield
A macro to help define serialization and deserialization for prime field implementations that use `$field::Repr`` representations. This assumes the concerned type implements PrimeField (for from_repr, to_repr).

Structs§

Coordinates
The affine coordinates of a point on an elliptic curve.
ExtendedNielsPoint
This is a pre-processed version of an extended point (U, V, Z, T1, T2) in the form (V + U, V - U, Z, T1 * T2 * 2d).
Fr
Represents an element of the scalar field $\mathbb{F}_r$ of the Jubjub elliptic curve construction.
JubjubAffine
This represents a Jubjub point in the affine (u, v) coordinates.
JubjubAffineNiels
This is a pre-processed version of an affine point (u, v) in the form (v + u, v - u, u * v * 2d). This can be added to an JubjubExtended.
JubjubExtended
This represents an extended point (U, V, Z, T1, T2) with Z nonzero, corresponding to the affine point (U/Z, V/Z). We always have T1 * T2 = UV/Z.
JubjubSubgroup
This represents a point in the prime-order subgroup of Jubjub, in extended coordinates.

Constants§

EDWARDS_D
D constant for an Twisted Edwards curve.
MODULUS
Constant representing the modulus r = 0x0e7db4ea6533afa906673b0101343b00a6682093ccc81082d0970e5ed6f72cb7

Traits§

CurveAffine
This trait is the affine counterpart to Curve and is used for serialization, storage in memory, and inspection of $x$ and $y$ coordinates.
CurveExt
This trait is a common interface for dealing with elements of an elliptic curve group in a “projective” form, where that arithmetic is usually more efficient.

Functions§

batch_normalize
This takes a mutable slice of ExtendedPoints and “normalizes” them using only a single inversion for the entire batch. This normalization results in all of the points having a Z-coordinate of one. Further, an iterator is returned which can be used to obtain AffinePoints for each element in the slice.

Type Aliases§

Base
Represents an element of the base field $\mathbb{F}_q$ of the Jubjub elliptic curve construction.