MayoKeyPairGenerator (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.pqc.crypto.mayo

## Class MayoKeyPairGenerator

- java.lang.Object
- - org.bouncycastle.pqc.crypto.mayo.MayoKeyPairGenerator

- All Implemented Interfaces:
    AsymmetricCipherKeyPairGenerator

      public class MayoKeyPairGenerator
      extends java.lang.Object
      implements AsymmetricCipherKeyPairGenerator

  Implementation of the MAYO asymmetric key pair generator following the MAYO signature scheme specifications.

  This generator produces `MayoPublicKeyParameters` and `MayoPrivateKeyParameters` based on the MAYO algorithm parameters. The implementation follows the specification defined in the official MAYO documentation and reference implementation.

  References:

  - MAYO Official Website
  - MAYO Specification Document
  - MAYO Reference Implementation (C)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MayoKeyPairGenerator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AsymmetricCipherKeyPair` | `generateKeyPair()` Generates a new asymmetric key pair following the MAYO algorithm specifications.
    `void` | `init(KeyGenerationParameters param)` intialise the key pair generator.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MayoKeyPairGenerator

          public MayoKeyPairGenerator()

  - ### Method Detail

    - #### init

          public void init(KeyGenerationParameters param)

      Description copied from interface: `AsymmetricCipherKeyPairGenerator`
      intialise the key pair generator.
      Specified by:
        `init` in interface `AsymmetricCipherKeyPairGenerator`
      Parameters:
        `param` - the parameters the key pair is to be initialised with.

    - #### generateKeyPair

          public AsymmetricCipherKeyPair generateKeyPair()

      Generates a new asymmetric key pair following the MAYO algorithm specifications.

      The key generation process follows these steps:

      1. Initializes parameter dimensions from `MayoParameters`
      2. Generates secret key seed using a secure random generator
      3. Derives public key seed using SHAKE-256
      4. Expands matrix parameters P1 and P2
      5. Performs GF(16) matrix operations for key material generation
      6. Assembles and packages the public key components
      7. Securely clears temporary buffers containing sensitive data
      Specified by:
        `generateKeyPair` in interface `AsymmetricCipherKeyPairGenerator`
      Returns:
        A valid MAYO key pair containing public and private key parameters