# blstrs

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

## Structs

 BitIterator Bls12 Bls12-381 engine CPU_SUPPORTS_ADX_INSTRUCTION Fp Fp values are always in Montgomery form; i.e., Scalar(a) = aR mod p, with R = 2^384. Fp2 Fp6 This represents an element $c_0 + c_1 v + c_2 v^2$ of $\mathbb{F}{p^6} = \mathbb{F}{p^2} / v^3 - u - 1$. Fp12 This represents an element $c_0 + c_1 w$ of $\mathbb{F}{p^12} = \mathbb{F}{p^6} / w^2 - v$. FpRepr Representation of a Fp, in regular coordinates. G1Affine This is an element of $\mathbb{G}_1$ represented in the affine coordinate space. It is ideal to keep elements in this representation to reduce memory usage and improve performance through the use of mixed curve model arithmetic. G1Compressed G1Projective This is an element of $\mathbb{G}_1$ represented in the projective coordinate space. G1Uncompressed G2Affine This is an element of $\mathbb{G}_2$ represented in the affine coordinate space. It is ideal to keep elements in this representation to reduce memory usage and improve performance through the use of mixed curve model arithmetic. G2Compressed G2Prepared G2Projective This is an element of $\mathbb{G}_2$ represented in the projective coordinate space. G2Uncompressed Scalar Represents an element of the scalar field $\mathbb{F}_q$ of the BLS12-381 elliptic curve construction. ScalarRepr Representation of a Scalar, in regular coordinates.

## Enums

 LegendreSymbol PrimeFieldDecodingError An error that may occur when trying to interpret a PrimeFieldRepr as a PrimeField element.

## Constants

 SCALAR_S

## Traits

 Engine with well-defined relationships. In particular, the G1/G2 curve groups are of prime order r, and are equipped with a bilinear pairing function. Field This trait represents an element of a field. PairingCurveAffine Affine representation of an elliptic curve point that can be used to perform pairings. PrimeField This represents an element of a prime field. PrimeFieldRepr This trait represents a wrapper around a biginteger which can encode any element of a particular prime field. It is a smart wrapper around a sequence of u64 limbs, least-significant digit first. ScalarEngine An "engine" is a collection of types (fields, elliptic curve groups, etc.) with well-defined relationships. Specific relationships (for example, a pairing-friendly curve) can be defined in a subtrait. SqrtField This trait represents an element of a field that has a square root operation described for it.

## Functions

 adc Calculate a + b + carry, returning the sum and modifying the carry value. mac_with_carry Calculate a + (b * c) + carry, returning the least significant digit and setting carry to the most significant digit. mod_mul_4w_assign pairing Execute a complete pairing operation (p, q). sbb Calculate a - b - borrow, returning the result and modifying the borrow value.