All Implemented Interfaces:
CipherParameters

public class MLKEMPrivateKeyParametersextends MLKEMKeyParameters
Private key parameters for ML-KEM (Module-Lattice Key Encapsulation Mechanism). Contains the private key components including seed, secret, and related values.
  • Field Details

    • s

      final byte[] s
      Secret vector s.
    • hpk

      final byte[] hpk
      Hash of public key.
    • nonce

      final byte[] nonce
      Nonce value.
    • t

      final byte[] t
      Public key t component.
    • rho

      final byte[] rho
      Public key rho component.
    • seed

      final byte[] seed
      Optional seed for deterministic key gen.
  • Constructor Details

    • MLKEMPrivateKeyParameters

      public MLKEMPrivateKeyParameters(MLKEMParameters params, byte[] s, byte[] hpk, byte[] nonce, byte[] t, byte[] rho)
      Builds a private key from its already separated components.
      Parameters:
      params - the ML-KEM parameter set this key belongs to
      s - the secret vector
      hpk - the hash of the corresponding public key
      nonce - the 32-byte nonce carried alongside the key material
      t - the public key t component
      rho - the public key rho component
    • MLKEMPrivateKeyParameters

      public MLKEMPrivateKeyParameters(MLKEMParameters params, byte[] s, byte[] hpk, byte[] nonce, byte[] t, byte[] rho, byte[] seed)
      Builds a private key from its components and regeneration seed.
      Parameters:
      params - the ML-KEM parameter set this key belongs to
      s - the secret vector
      hpk - the hash of the corresponding public key
      nonce - the 32-byte nonce carried alongside the key material
      t - the public key t component
      rho - the public key rho component
      seed - the optional seed permitting deterministic regeneration of the key, or null when the key was not generated from one
    • MLKEMPrivateKeyParameters

      public MLKEMPrivateKeyParameters(MLKEMParameters params, byte[] encoding)
      Rebuilds a private key from a seed-based or expanded encoding.
      Parameters:
      params - the ML-KEM parameter set this key belongs to
      encoding - the private key in either the seed-based or the expanded packed form
  • Method Details

    • getEncoded

      public byte[] getEncoded()
      Returns the expanded encoding of this key.
      Returns:
      the concatenation of s, t, rho, hpk and nonce, the expanded form accepted by the two-argument constructor
    • getHPK

      public byte[] getHPK()
      Returns a copy of the public key hash.
      Returns:
      a copy of the hash of the corresponding public key
    • getNonce

      public byte[] getNonce()
      Returns a copy of the nonce.
      Returns:
      a copy of the nonce value
    • getPublicKey

      public byte[] getPublicKey()
      Public key.
      Returns:
      the encoded public key matching this private key
    • getPublicKeyParameters

      public MLKEMPublicKeyParameters getPublicKeyParameters()
      Public key parameters.
      Returns:
      the public key parameters matching this private key
    • getRho

      public byte[] getRho()
      Returns a copy of the public key rho component.
      Returns:
      a copy of the public key rho component
    • getS

      public byte[] getS()
      Returns a copy of the secret vector.
      Returns:
      a copy of the secret vector
    • getT

      public byte[] getT()
      Returns a copy of the public key t component.
      Returns:
      a copy of the public key t component
    • getSeed

      public byte[] getSeed()
      Returns a copy of the deterministic key generation seed.
      Returns:
      a copy of the deterministic key generation seed, or null when this key was not generated from one