Package org.bouncycastle.pqc.crypto.mayo
Class MayoSigner
- java.lang.Object
-
- org.bouncycastle.pqc.crypto.mayo.MayoSigner
-
- All Implemented Interfaces:
MessageSigner
public class MayoSigner extends java.lang.Object implements 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 Constructor Description MayoSigner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
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.
-
-
-
Method Detail
-
init
public void init(boolean forSigning, CipherParameters param)
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:
java.lang.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:
- MAYO Spec Algorithm 8 and 10
-
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:
- MAYO Spec Algorithm 9 and 11
-
-