Class BLS12_381BasicScheme
java.lang.Object
org.bouncycastle.crypto.bls.BLS12_381BasicScheme
BLS signatures BasicScheme over BLS12-381, per draft-irtf-cfrg-bls-signature
(variant: public keys in G1, signatures in G2; suite
BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_).
Provides the algorithmic core: KeyGen, SkToPk, Sign, Verify, KeyValidate,
and aggregate verification. The static API operates on in-memory math
objects (BigInteger secret keys, ECPoint public keys,
byte-array messages, BLS12_381G2Point signatures);
BLS12_381Serialization converts to and from the spec's
Zcash-format compressed encodings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[]Domain-separation tag for hash-to-curve under the BasicScheme suite. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaggregateVerify(ECPoint[] pks, byte[][] messages, BLS12_381G2Point sigAgg) Aggregate verification under the BasicScheme.static BigIntegerkeyGen(byte[] ikm, byte[] keyInfo) Derive a secret key from input keying material per draft-irtf-cfrg-bls-signature sec. 2.3.static booleankeyValidate(ECPoint pk) Validate a public key per draft-irtf-cfrg-bls-signature sec. 2.5: non-identity, on the G1 curve, and in the prime-order subgroup.static BLS12_381G2Pointsign(BigInteger sk, byte[] message) Sign a message under the BasicScheme:sig = sk * H(message)whereHis hash-to-G2 with the suite's DST.static ECPointskToPk(BigInteger sk) Derive the public key for a given secret key:PK = sk * G1_gen.static booleanverify(ECPoint pk, byte[] message, BLS12_381G2Point signature) Verify a BasicScheme signature.
-
Field Details
-
DST
public static final byte[] DSTDomain-separation tag for hash-to-curve under the BasicScheme suite.
-
-
Method Details
-
keyGen
Derive a secret key from input keying material per draft-irtf-cfrg-bls-signature sec. 2.3.Same
(ikm, keyInfo)input always produces the same secret key, soikmshould come from a high-entropy source the caller controls (e.g.SecureRandom.nextBytes).- Parameters:
ikm- input keying material; the spec requires at least 32 bytes.keyInfo- optional context binding; pass an empty array if not used.- Returns:
- a secret key
0 < sk < r.
-
skToPk
Derive the public key for a given secret key:PK = sk * G1_gen. -
keyValidate
Validate a public key per draft-irtf-cfrg-bls-signature sec. 2.5: non-identity, on the G1 curve, and in the prime-order subgroup. -
sign
Sign a message under the BasicScheme:sig = sk * H(message)whereHis hash-to-G2 with the suite's DST. -
verify
Verify a BasicScheme signature. Returnstrueiffpkis a valid G1 point in the prime-order subgroup,signatureis a valid G2 point in the prime-order subgroup, and the pairing equatione(G1_gen, sig) == e(pk, H(message))holds. -
aggregateVerify
Aggregate verification under the BasicScheme. Per draft-irtf-cfrg-bls-signature sec. 3.1.1, the messages must all be distinct — otherwise an attacker holding sk_1 and a victim public key pk_2 can forge an aggregate by setting sig_1 = sk_1*H(m), sig_2 arbitrary such that sig_1 + sig_2 cancels into a known value. The MessageAugmentation and ProofOfPossession suites avoid this requirement structurally; this BasicScheme variant enforces it.
-