Class NTRUParameterSet

java.lang.Object
org.bouncycastle.pqc.math.ntru.parameters.NTRUParameterSet
Direct Known Subclasses:
NTRUHPSParameterSet, NTRUHRSSParameterSet

public abstract class NTRUParameterSet extends Object
Abstract class for all NTRU parameter sets.
See Also:
  • Constructor Details

    • NTRUParameterSet

      public NTRUParameterSet(int n, int logQ, int seedBytes, int prfKeyBytes, int sharedKeyBytes)
  • Method Details

    • createPolynomial

      public abstract Polynomial createPolynomial()
      Creates a polynomial based on this parameter set.
      Returns:
      an instance of Polynomial
    • n

      public int n()
      n
      Returns:
      n is a prime and both 2 and 3 are of order n − 1 in (Z/n)×
    • logQ

      public int logQ()
      logq
      Returns:
      log2(q)
    • q

      public int q()
      q
      Returns:
      q is a power of two
    • seedBytes

      public int seedBytes()
      The number of random bytes consumed by keygen.
      Returns:
      key_seed_bits/8
    • prfKeyBytes

      public int prfKeyBytes()
      The number of bytes used to key the implicit rejection mechanism.
      Returns:
      prf_key_bits/8
    • sharedKeyBytes

      public int sharedKeyBytes()
      Returns:
      kem_shared_key_bits/8
    • sampleIidBytes

      public int sampleIidBytes()
      Returns:
      sample_iid_bits/8
    • sampleFixedTypeBytes

      public int sampleFixedTypeBytes()
      Returns:
      sample_xed_type_bits
    • sampleFgBytes

      public abstract int sampleFgBytes()
      Returns:
      sample_key_bits/8
    • sampleRmBytes

      public abstract int sampleRmBytes()
      Returns:
      sample_plaintext_bits/8
    • packDegree

      public int packDegree()
    • packTrinaryBytes

      public int packTrinaryBytes()
      Returns:
      packed_s3_bytes
    • owcpaMsgBytes

      public int owcpaMsgBytes()
      The number of bytes in a plaintext for the DPKE.
      Returns:
      dpke_plaintext_bytes
    • owcpaPublicKeyBytes

      public int owcpaPublicKeyBytes()
      The number of bytes in a public key for the DPKE.
      Returns:
      dpke_public_key_bytes
    • owcpaSecretKeyBytes

      public int owcpaSecretKeyBytes()
      The number of bytes in a private key for the DPKE.
      Returns:
      dpke_private_key_bytes
    • owcpaBytes

      public int owcpaBytes()
      The number of bytes in a ciphertext for the DPKE.
      Returns:
      dpke_ciphertext_bytes
    • ntruPublicKeyBytes

      public int ntruPublicKeyBytes()
      The number of bytes in a public key for the KEM.
      Returns:
      kem_public_key_bytes
    • ntruSecretKeyBytes

      public int ntruSecretKeyBytes()
      The number of bytes in a private key for the KEM.
      Returns:
      kem_private_key_bytes
    • ntruCiphertextBytes

      public int ntruCiphertextBytes()
      The number of bytes in a ciphertext for the KEM.
      Returns:
      kem_ciphertext_bytes