Package org.bouncycastle.pqc.crypto.mayo
Class MayoSigner
java.lang.Object
org.bouncycastle.pqc.crypto.mayo.MayoSigner
- All Implemented Interfaces:
MessageSigner
Implementation of the MAYO digital signature scheme as specified in the MAYO documentation.
This class provides functionality for both signature generation and verification.
MAYO is a candidate in the NIST Post-Quantum Cryptography: Additional Digital Signature Schemes project, currently in Round 2 of evaluations. For more details about the NIST standardization process, see: NIST PQC Additional Digital Signatures.
References:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
generateSignature
(byte[] message) Generates a MAYO signature for the given message using the initialized private key.void
init
(boolean forSigning, CipherParameters param) Initializes the signer for either signature generation or verification.boolean
verifySignature
(byte[] message, byte[] signature) Verifies a MAYO signature against the initialized public key and message.
-
Constructor Details
-
MayoSigner
public MayoSigner()
-
-
Method Details
-
init
Initializes the signer for either signature generation or verification.- Specified by:
init
in interfaceMessageSigner
- Parameters:
forSigning
-true
for signing mode,false
for verificationparam
- CipherParameters containing:ParametersWithRandom
withMayoPrivateKeyParameters
(for signing)MayoPublicKeyParameters
(for verification)
- Throws:
IllegalArgumentException
- if invalid parameters are provided
-
generateSignature
public byte[] generateSignature(byte[] message) Generates a MAYO signature for the given message using the initialized private key. Follows the signature generation process outlined in the MAYO specification document.- Specified by:
generateSignature
in interfaceMessageSigner
- Parameters:
message
- The message to be signed- Returns:
- The signature bytes concatenated with the original message
- See Also:
-
verifySignature
public boolean verifySignature(byte[] message, byte[] signature) Verifies a MAYO signature against the initialized public key and message. Implements the verification process specified in the MAYO documentation.- Specified by:
verifySignature
in interfaceMessageSigner
- Parameters:
message
- The original messagesignature
- The signature to verify- Returns:
true
if the signature is valid,false
otherwise- See Also:
-