public class BLS12_381BasicScheme
extends java.lang.Object
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.
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
DST
Domain-separation tag for hash-to-curve under the BasicScheme suite.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
aggregateVerify(ECPoint[] pks,
byte[][] messages,
BLS12_381G2Point sigAgg)
Aggregate verification under the BasicScheme.
|
static java.math.BigInteger |
keyGen(byte[] ikm,
byte[] keyInfo)
Derive a secret key from input keying material per
draft-irtf-cfrg-bls-signature sec. 2.3.
|
static boolean |
keyValidate(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_381G2Point |
sign(java.math.BigInteger sk,
byte[] message)
Sign a message under the BasicScheme:
sig = sk * H(message)
where H is hash-to-G2 with the suite's DST. |
static ECPoint |
skToPk(java.math.BigInteger sk)
Derive the public key for a given secret key:
PK = sk * G1_gen. |
static boolean |
verify(ECPoint pk,
byte[] message,
BLS12_381G2Point signature)
Verify a BasicScheme signature.
|
public static final byte[] DST
public static java.math.BigInteger keyGen(byte[] ikm,
byte[] keyInfo)
Same (ikm, keyInfo) input always produces the same secret key,
so ikm should come from a high-entropy source the caller
controls (e.g. SecureRandom.nextBytes).
ikm - input keying material; the spec requires at least 32 bytes.keyInfo - optional context binding; pass an empty array if not used.0 < sk < r.public static ECPoint skToPk(java.math.BigInteger sk)
PK = sk * G1_gen.public static boolean keyValidate(ECPoint pk)
public static BLS12_381G2Point sign(java.math.BigInteger sk, byte[] message)
sig = sk * H(message)
where H is hash-to-G2 with the suite's DST.public static boolean verify(ECPoint pk, byte[] message, BLS12_381G2Point signature)
true iff
pk is a valid G1 point in the prime-order subgroup,
signature is a valid G2 point in the prime-order subgroup,
and the pairing equation e(G1_gen, sig) == e(pk, H(message))
holds.public static boolean aggregateVerify(ECPoint[] pks, byte[][] messages, BLS12_381G2Point sigAgg)