Class NtruKeyGenSpec

java.lang.Object
zeroecho.core.alg.ntru.NtruKeyGenSpec
All Implemented Interfaces:
Describable, AlgorithmKeySpec

public final class NtruKeyGenSpec extends Object implements AlgorithmKeySpec, Describable
NtruKeyGenSpec selects an NTRU parameter set for key pair generation.

This specification is consumed by the asymmetric key builder registered by NtruAlgorithm. Each factory method corresponds to a concrete parameter set from the NTRU-HPS or NTRU-HRSS families. Larger parameter sets generally trade bigger keys and ciphertexts for higher security margins.

Usage

// Choose a parameter set and generate a key pair
NtruAlgorithm alg = new NtruAlgorithm();
KeyPair kp = alg.asymmetricKeyPairGenerator(NtruKeyGenSpec.class)
                .generateKeyPair(NtruKeyGenSpec.hrss701());

Instances are immutable and can be safely reused across threads.

Since:
1.0
  • Method Details

    • hps2048_509

      public static NtruKeyGenSpec hps2048_509()
      Returns a spec for the NTRU-HPS-2048-509 parameter set.
      Returns:
      a new key generation spec for HPS-2048-509
    • hps2048_677

      public static NtruKeyGenSpec hps2048_677()
      Returns a spec for the NTRU-HPS-2048-677 parameter set.
      Returns:
      a new key generation spec for HPS-2048-677
    • hps4096_821

      public static NtruKeyGenSpec hps4096_821()
      Returns a spec for the NTRU-HPS-4096-821 parameter set.
      Returns:
      a new key generation spec for HPS-4096-821
    • hps4096_1229

      public static NtruKeyGenSpec hps4096_1229()
      Returns a spec for the NTRU-HPS-4096-1229 parameter set.
      Returns:
      a new key generation spec for HPS-4096-1229
    • hrss701

      public static NtruKeyGenSpec hrss701()
      Returns a spec for the NTRU-HRSS-701 parameter set.

      This is a sensible default in many deployments when an HRSS choice is desired.

      Returns:
      a new key generation spec for HRSS-701
    • hrss1373

      public static NtruKeyGenSpec hrss1373()
      Returns a spec for the NTRU-HRSS-1373 parameter set.
      Returns:
      a new key generation spec for HRSS-1373
    • variant

      public NtruKeyGenSpec.Variant variant()
      Returns the selected NTRU parameter variant.
      Returns:
      the variant represented by this spec
    • description

      public String description()
      Returns a short, human-readable description of the selected parameter set.
      Specified by:
      description in interface Describable
      Returns:
      the variant name as a string