Class KyberKeyGenSpec
java.lang.Object
zeroecho.core.alg.kyber.KyberKeyGenSpec
- All Implemented Interfaces:
Describable, AlgorithmKeySpec
Key generation specification for the Kyber (ML-KEM) algorithm family.
KyberKeyGenSpec captures the choice of Kyber parameter set when
generating a key pair. Kyber is a post-quantum key encapsulation mechanism
(KEM) standardized as ML-KEM. The three supported security levels are
represented by KyberKeyGenSpec.Variant values:
KyberKeyGenSpec.Variant.KYBER512- lowest cost, NIST level 1 security,KyberKeyGenSpec.Variant.KYBER768- balanced choice, NIST level 3 security,KyberKeyGenSpec.Variant.KYBER1024- strongest, NIST level 5 security.
Usage
Instances of this class are passed to the Kyber key builder to select the desired parameter set:CryptoAlgorithm kyber = new KyberAlgorithm();
KeyPair kp = kyber.asymmetricKeyPairGenerator(KyberKeyGenSpec.class)
.generateKeyPair(KyberKeyGenSpec.kyber768());
The spec is immutable and may be safely shared between threads.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumerates the supported Kyber parameter sets. -
Method Summary
Modifier and TypeMethodDescriptionReturns a human-readable description of this spec.static KyberKeyGenSpecCreates a specification for Kyber-1024 key generation.static KyberKeyGenSpeckyber512()Creates a specification for Kyber-512 key generation.static KyberKeyGenSpeckyber768()Creates a specification for Kyber-768 key generation.variant()Returns the variant associated with this specification.
-
Method Details
-
kyber512
Creates a specification for Kyber-512 key generation.- Returns:
- a new spec bound to
KyberKeyGenSpec.Variant.KYBER512
-
kyber768
Creates a specification for Kyber-768 key generation.- Returns:
- a new spec bound to
KyberKeyGenSpec.Variant.KYBER768
-
kyber1024
Creates a specification for Kyber-1024 key generation.- Returns:
- a new spec bound to
KyberKeyGenSpec.Variant.KYBER1024
-
variant
Returns the variant associated with this specification.- Returns:
- the Kyber parameter set
-
description
Returns a human-readable description of this spec.The description is the variant name, e.g.,
"KYBER768".- Specified by:
descriptionin interfaceDescribable- Returns:
- string description of the spec
-