class BLS12381
(source)
This Boneh-Lynn-Shacham (BLS) signature implementation is constructed from a pairing friendly elliptic curve, the BLS12-381 curve. It uses parameters as defined in https://z.cash/blog/new-snark-curve and the points in groups G1 and G2 are defined https://github.com/zkcrypto/pairing/blob/master/src/bls12_381/README.md
This class depends upon the Apache Milagro library being available. See https://milagro.apache.org.
Apache Milagro can be included using the gradle dependency 'org.miracl.milagro.amcl:milagro-crypto-java'.
static fun sign(keyPair: KeyPair, message: ByteArray, domain: Int): SignatureAndPublicKey static fun sign(keyPair: KeyPair, message: Bytes, domain: Int): SignatureAndPublicKey
Generates a SignatureAndPublicKey. |
|
static fun verify(publicKey: PublicKey, signature: Signature, message: ByteArray, domain: Int): Boolean static fun verify(publicKey: PublicKey, signature: Signature, message: Bytes, domain: Int): Boolean static fun verify(sigAndPubKey: SignatureAndPublicKey, message: ByteArray, domain: Int): Boolean static fun verify(sigAndPubKey: SignatureAndPublicKey, message: Bytes, domain: Int): Boolean
Verifies the given BLS signature against the message bytes using the public key. |