java.lang.Object
org.bouncycastle.crypto.params.AsymmetricKeyParameter
org.bouncycastle.pqc.crypto.mlkem.MLKEMKeyParameters
org.bouncycastle.pqc.crypto.mlkem.MLKEMPrivateKeyParameters
- All Implemented Interfaces:
CipherParameters
Private key parameters for ML-KEM (Module-Lattice Key Encapsulation Mechanism). Contains the private key components including seed, secret, and related values.
Field Summary
FieldsModifier and TypeFieldDescription(package private) final byte[]Hash of public key.(package private) final byte[]Nonce value.(package private) final byte[]Public key rho component.(package private) final byte[]Secret vector s.(package private) final byte[]Optional seed for deterministic key gen.(package private) final byte[]Public key t component.Constructor Summary
ConstructorsConstructorDescriptionMLKEMPrivateKeyParameters(MLKEMParameters params, byte[] encoding) Rebuilds a private key from a seed-based or expanded encoding.MLKEMPrivateKeyParameters(MLKEMParameters params, byte[] s, byte[] hpk, byte[] nonce, byte[] t, byte[] rho) Builds a private key from its already separated components.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.Method Summary
All MethodsModifier and TypeMethodDescriptionbyte[]Returns the expanded encoding of this key.byte[]getHPK()Returns a copy of the public key hash.byte[]getNonce()Returns a copy of the nonce.byte[]Public key.Public key parameters.byte[]getRho()Returns a copy of the public key rho component.byte[]getS()Returns a copy of the secret vector.byte[]getSeed()Returns a copy of the deterministic key generation seed.byte[]getT()Returns a copy of the public key t component.Methods inherited from class MLKEMKeyParameters
getParametersModifier and TypeMethodDescriptionReturns the ML-KEM parameter set this key was created with.Methods inherited from class AsymmetricKeyParameter
isPrivate
Field Details
s
final byte[] sSecret vector s.hpk
final byte[] hpkHash of public key.nonce
final byte[] nonceNonce value.t
final byte[] tPublic key t component.rho
final byte[] rhoPublic key rho component.seed
final byte[] seedOptional 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 tos- the secret vectorhpk- the hash of the corresponding public keynonce- the 32-byte nonce carried alongside the key materialt- the public key t componentrho- 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 tos- the secret vectorhpk- the hash of the corresponding public keynonce- the 32-byte nonce carried alongside the key materialt- the public key t componentrho- the public key rho componentseed- the optional seed permitting deterministic regeneration of the key, or null when the key was not generated from one
MLKEMPrivateKeyParameters
Rebuilds a private key from a seed-based or expanded encoding.- Parameters:
params- the ML-KEM parameter set this key belongs toencoding- 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 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