Package org.bouncycastle.crypto.bls
Class BLS12_381MessageAugmentation
- java.lang.Object
-
- org.bouncycastle.crypto.bls.BLS12_381MessageAugmentation
-
public class BLS12_381MessageAugmentation extends java.lang.ObjectBLS signatures MessageAugmentation suite over BLS12-381, per draft-irtf-cfrg-bls-signature: signature suiteBLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_AUG_.Differs from
BLS12_381BasicSchemeby prepending the public-key encoding to the message before hashing. The augmentation defends against rogue-key attacks in aggregate-verification without the standalone proof-of-possession step thatBLS12_381ProofOfPossessionrequires.The public-key prefix used in the hash-to-curve input is the Zcash-format 48-byte compressed G1 encoding produced by
BLS12_381Serialization.compressG1(org.bouncycastle.math.ec.ECPoint), matching draft-irtf-cfrg-bls-signature'spoint_to_pubkeyso signatures are potentially interoperable with other BLS implementations once verified against published test vectors.
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]DST
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanaggregateVerify(ECPoint[] pks, byte[][] messages, BLS12_381G2Point sigAgg)Aggregate verification under the MessageAugmentation suite.static BLS12_381G2Pointsign(java.math.BigInteger sk, byte[] message)Sign under the MessageAugmentation suite:sig = sk * H(SkToPk(sk) || message)with the AUG DST.static booleanverify(ECPoint pk, byte[] message, BLS12_381G2Point signature)Verify under the MessageAugmentation suite.
-
-
-
Method Detail
-
sign
public static BLS12_381G2Point sign(java.math.BigInteger sk, byte[] message)
Sign under the MessageAugmentation suite:sig = sk * H(SkToPk(sk) || message)with the AUG DST.
-
verify
public static boolean verify(ECPoint pk, byte[] message, BLS12_381G2Point signature)
Verify under the MessageAugmentation suite. Returnstrueiffpkis a valid prime-order G1 point,signatureis a valid prime-order G2 point, and the pairing equatione(G1_gen, sig) == e(pk, H(pk || message))holds.
-
aggregateVerify
public static boolean aggregateVerify(ECPoint[] pks, byte[][] messages, BLS12_381G2Point sigAgg)
Aggregate verification under the MessageAugmentation suite. Distinct messages are not required: the augmentation makes eachH(pk_i || msg_i)input unique even when themsg_irepeat.
-
-