Expand description
BLS signatures over BLS12-381 with minimum-size public keys.
This module implements the Basic, Message Augmentation, and Proof of
Possession schemes from draft-irtf-cfrg-bls-signature-07. Public keys are
48-byte compressed G1 points and signatures are 96-byte compressed G2
points. Eth2Bls12381G2PopV4 is a deliberately separate adapter for the
legacy draft-v4 profile retained by Ethereum consensus.
The standard profile is pinned to
draft-irtf-cfrg-bls-signature-07,
published 6 July 2026. That draft’s Appendix B still marks minimum-public-
key vectors as TBA; dcrypt therefore combines published EIP-2333 v4 KeyGen
vectors with byte-for-byte tests against an independent BLS12-381 oracle in
the excluded verification workspace.
use dcrypt_sign::bls::{Bls12381G2Basic, Bls12381SecretKey};
// Production IKM must be at least 32 unpredictable bytes. Draft-07 also
// requires the caller to choose the salt explicitly.
let ikm = [7u8; 32];
let secret = Bls12381SecretKey::key_gen(&ikm, b"example application salt")?;
let public = secret.public_key()?;
let signature = Bls12381G2Basic::sign(&secret, b"message")?;
Bls12381G2Basic::verify(&public, b"message", &signature)?;Secret keys are non-Copy, non-Clone, exact-width clearing owners. They
never expose a plain byte-array serialization. The arithmetic bridge uses a
fixed 256-bit scalar-multiplication schedule and explicitly clears scalar
and byte temporaries; target-specific compiler inspection remains necessary
for a concrete side-channel claim.
Structs§
- Bls12381
G2Basic - Draft-07 minimum-public-key Basic scheme.
- Bls12381
G2Message Augmentation - Draft-07 minimum-public-key Message Augmentation scheme.
- Bls12381
G2Proof OfPossession - Draft-07 minimum-public-key Proof of Possession scheme.
- Bls12381
Proof OfPossession - Canonical prime-subgroup proof of possession in G2.
- Bls12381
Public Key - Canonical, nonidentity, prime-subgroup minimum-size public key in G1.
- Bls12381
Secret Key - Protected canonical nonzero BLS12-381 secret scalar.
- Bls12381
Signature - Canonical prime-subgroup signature in G2.
- Eth2
Bls12381 G2Pop V4 - Ethereum consensus adapter for the minimum-public-key draft-v4 PoP profile.
Constants§
- BLS_
AUG_ G2_ DST - Draft-07 minimum-public-key Message Augmentation domain separation tag.
- BLS_
BASIC_ G2_ DST - Draft-07 minimum-public-key Basic ciphersuite domain separation tag.
- BLS_
POP_ G2_ DST - Draft-07 minimum-public-key Proof of Possession signature tag.
- BLS_
POP_ PROOF_ G2_ DST - Draft-07 minimum-public-key proof-generation tag, distinct from signatures.
- BLS_
PUBLIC_ KEY_ SIZE - Size of a compressed minimum-size BLS12-381 public key in G1.
- BLS_
SECRET_ KEY_ SIZE - Size of a canonical BLS12-381 secret scalar encoding.
- BLS_
SIGNATURE_ SIZE - Size of a compressed minimum-public-key BLS12-381 signature in G2.