Module group

Module group 

Source
Expand description

Group operations over the BLS12-381 scalar field.

This crate implements basic group operations over BLS12-381 elements, including point addition, scalar multiplication, and pairing operations.

§Warning

Ensure that points are checked to belong to the correct subgroup (G1 or G2) to prevent small subgroup attacks. This is particularly important when handling deserialized points or points received from untrusted sources. This is already taken care of for you if you use the provided deserialize function.

Structs§

G1
A point on the BLS12-381 G1 curve.
G2
A point on the BLS12-381 G2 curve.
GT
The target group of the BLS12-381 pairing.
Scalar
Wrapper around blst_fr that represents an element of the BLS12‑381 scalar field F_r.
Share
A share of a threshold signing key.

Constants§

G1_ELEMENT_BYTE_LENGTH
The size in bytes of an encoded G1 element.
G1_MESSAGE
Domain separation tag for hashing a message to G1.
G1_PROOF_OF_POSSESSION
Domain separation tag for hashing a proof of possession (compressed G2) to G1.
G2_ELEMENT_BYTE_LENGTH
The size in bytes of an encoded G2 element.
G2_MESSAGE
Domain separation tag for hashing a message to G2.
G2_PROOF_OF_POSSESSION
Domain separation tag for hashing a proof of possession (compressed G1) to G2.
GT_ELEMENT_BYTE_LENGTH
The size in bytes of an encoded GT element.
PRIVATE_KEY_LENGTH
The private key length.
SCALAR_LENGTH
Number of bytes required to encode a scalar in its canonical little‑endian form (32 × 8 = 256 bits).

Traits§

Element
An element of a group.
Point
A point on a curve.

Type Aliases§

DST
Domain separation tag used when hashing a message to a curve (G1 or G2).
Private
The private key type.