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.
MESSAGE
The DST for hashing a message to the default signature type (G2).
PRIVATE_KEY_LENGTH
The private key length.
PROOF_OF_POSSESSION
The DST for hashing a proof of possession to the default signature type (G2).
PUBLIC_KEY_LENGTH
The default public key length (G1).
SIGNATURE_LENGTH
The default signature length (G2).

Traits§

Element
An element of a group.
Point
An element of a group that supports message hashing.

Type Aliases§

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