Class NtrulPrimeKeyGenSpec
- All Implemented Interfaces:
Describable, AlgorithmKeySpec
NtrulPrimeKeyGenSpec selects one of the standardized parameter
variants of the NTRU LPRime key encapsulation mechanism. Each variant
determines the security level, key sizes, and performance characteristics of
the generated key pair.
Variants
NtrulPrimeKeyGenSpec.Variant.NTRULPR653: ~128-bit classical security.NtrulPrimeKeyGenSpec.Variant.NTRULPR761: ~192-bit security.NtrulPrimeKeyGenSpec.Variant.NTRULPR857: ~256-bit security.NtrulPrimeKeyGenSpec.Variant.NTRULPR953,NtrulPrimeKeyGenSpec.Variant.NTRULPR1013,NtrulPrimeKeyGenSpec.Variant.NTRULPR1277: higher strength variants with progressively larger keys and ciphertexts.
Instances are immutable and passed to
KeyBuilders.Asymmetric.generateKeyPair(String, AlgorithmKeySpec).
Static factory methods are provided for each variant.
Example
KeyPair kp = session.keyBuilders().asymmetric()
.generateKeyPair("NTRULPRime", NtrulPrimeKeyGenSpec.ntrulpr761());
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of supported NTRU LPRime parameter sets. -
Method Summary
Modifier and TypeMethodDescriptionReturns a textual description of this specification.static NtrulPrimeKeyGenSpecCreates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR1013parameter set.static NtrulPrimeKeyGenSpecCreates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR1277parameter set.static NtrulPrimeKeyGenSpecCreates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR653parameter set.static NtrulPrimeKeyGenSpecCreates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR761parameter set.static NtrulPrimeKeyGenSpecCreates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR857parameter set.static NtrulPrimeKeyGenSpecCreates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR953parameter set.static NtrulPrimeKeyGenSpecCreates a specification from the given variant.variant()Returns the selected variant for this specification.
-
Method Details
-
of
Creates a specification from the given variant.- Parameters:
v- selected NTRU LPRime parameter set- Returns:
- new specification bound to
v - Throws:
NullPointerException- ifvisnull
-
ntrulpr653
Creates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR653parameter set.This variant offers around 128-bit classical security with relatively small key and ciphertext sizes, making it suitable for constrained environments.
- Returns:
- a new specification targeting
NTRULPR653
-
ntrulpr761
Creates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR761parameter set.This variant balances efficiency and strength, offering roughly 192-bit security. It is a common choice for post-quantum readiness in practical deployments.
- Returns:
- a new specification targeting
NTRULPR761
-
ntrulpr857
Creates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR857parameter set.This variant aims for ~256-bit classical security with larger keys and ciphertexts compared to the 653 and 761 sets, offering stronger margins.
- Returns:
- a new specification targeting
NTRULPR857
-
ntrulpr953
Creates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR953parameter set.Provides very high security beyond 256-bit classical strength, with larger key material and ciphertexts. Suitable for highly conservative use cases.
- Returns:
- a new specification targeting
NTRULPR953
-
ntrulpr1013
Creates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR1013parameter set.A higher-strength variant designed for long-term security horizons, offering protection well above 256-bit security levels at the cost of larger keys.
- Returns:
- a new specification targeting
NTRULPR1013
-
ntrulpr1277
Creates a key generation specification for theNtrulPrimeKeyGenSpec.Variant.NTRULPR1277parameter set.The largest standardized parameter set, offering the highest security margin and designed for long-term quantum resistance in highly sensitive applications.
- Returns:
- a new specification targeting
NTRULPR1277
-
variant
Returns the selected variant for this specification.- Returns:
- variant of NTRU LPRime key parameters
-
description
Returns a textual description of this specification.The description is the variant name (e.g.,
"NTRULPR761").- Specified by:
descriptionin interfaceDescribable- Returns:
- variant name string
-