Class BLSSigner
- All Implemented Interfaces:
Signer
Signer interface.
Signs and verifies under a configurable BLS hash-to-curve domain
separation tag, defaulting to the BasicScheme DST
BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_. The
BLSSigner(byte[]) constructor lets callers select the
ProofOfPossession DST
(BLS12_381ProofOfPossession.DST) for Eth2 interop, or supply any
other RFC 9380 DST.
Note that the MessageAugmentation suite is intentionally NOT supported
here, since its hash input is pk || msg — the pubkey must be
available at sign time, which doesn't fit the Signer
"sk + buffered message" contract cleanly. Callers wanting AUG should
use BLS12_381MessageAugmentation
directly.
Produces and accepts 96-byte Zcash-format compressed G2 signatures, the same encoding used by Eth2 / IETF draft-irtf-cfrg-bls-signature.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]generate a signature for the message we've been loaded with using the key we were initialised with.voidinit(boolean forSigning, CipherParameters param) Initialise the signer for signing or verification.voidreset()reset the internal statevoidupdate(byte b) update the internal digest with the byte bvoidupdate(byte[] in, int off, int len) update the internal digest with the byte array inbooleanverifySignature(byte[] signature) return true if the internal state represents the signature described in the passed in array.
-
Constructor Details
-
BLSSigner
public BLSSigner()Construct a signer with the BasicScheme DST (BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_). -
BLSSigner
public BLSSigner(byte[] dst) Construct a signer with an explicit hash-to-curve DST. For Eth2 interop passBLS12_381ProofOfPossession.DST.
-
-
Method Details
-
init
Description copied from interface:SignerInitialise the signer for signing or verification. -
update
-
update
-
generateSignature
Description copied from interface:Signergenerate a signature for the message we've been loaded with using the key we were initialised with.- Specified by:
generateSignaturein interfaceSigner- Throws:
CryptoException
-
verifySignature
public boolean verifySignature(byte[] signature) Description copied from interface:Signerreturn true if the internal state represents the signature described in the passed in array.- Specified by:
verifySignaturein interfaceSigner
-
reset
-