Crate bls_12_381

Source
Expand description

§Bls12 381 Curve

CI crates.io badge Documentation GitHub license codecov dependency status

Pairing friendly bls12-381 curve supports fully no_std and parity-scale-codec.

§Overview

This crate includes field and extension fields, curve implementation. There are two curve G1G1 and G2G2 described as following.

G1:y2=x3+4G1: y^2 = x^3 + 4

G2:y2=x3+4(u+1)G2: y^2 = x^3 + 4(u + 1)

These two group supports bilinearity by pairing. Let GG and HH be generator of G1G1, and G2G2, and ee be pairing function. The relationship is described as following.

e(aG,bH)=e(G,H)abe(aG, bH) = e(G, H)^{ab}

§Test

$ cargo test

Re-exports§

pub use params::EDWARDS_D;

Modules§

params
Bls12 381 construction and frobennius map constant

Structs§

Fq
Bls12 381 curve base field
Fq2
extension field of base field
Fq6
extension field of base field
Fq12
extension field of base field
Fr
Bls12 381 curve scalar field
G1Affine
The projective form of coordinate
G1Projective
The projective form of coordinate
G2Affine
The projective form of coordinate
G2PairingAffine
The pairing format coordinate
G2Projective
The projective form of coordinate
Gt
pairing target group of 12 degree extension of field
PairingCoeff
The coefficient for pairing affine format

Constants§

MULTIPLICATIVE_GENERATOR
generator of the scalar field
ROOT_OF_UNITY
multiplicative group generator of n th root of unity
TWO_ADACITY