Class NTRUParameterSet
- java.lang.Object
-
- org.bouncycastle.pqc.math.ntru.parameters.NTRUParameterSet
-
- Direct Known Subclasses:
NTRUHPSParameterSet
,NTRUHRSSParameterSet
public abstract class NTRUParameterSet extends java.lang.Object
Abstract class for all NTRU parameter sets.
-
-
Constructor Summary
Constructors Constructor Description NTRUParameterSet(int n, int logQ, int seedBytes, int prfKeyBytes, int sharedKeyBytes)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Polynomial
createPolynomial()
Creates a polynomial based on this parameter set.int
logQ()
logqint
n()
nint
ntruCiphertextBytes()
The number of bytes in a ciphertext for the KEM.int
ntruPublicKeyBytes()
The number of bytes in a public key for the KEM.int
ntruSecretKeyBytes()
The number of bytes in a private key for the KEM.int
owcpaBytes()
The number of bytes in a ciphertext for the DPKE.int
owcpaMsgBytes()
The number of bytes in a plaintext for the DPKE.int
owcpaPublicKeyBytes()
The number of bytes in a public key for the DPKE.int
owcpaSecretKeyBytes()
The number of bytes in a private key for the DPKE.int
packDegree()
int
packTrinaryBytes()
int
prfKeyBytes()
The number of bytes used to key the implicit rejection mechanism.int
q()
qabstract int
sampleFgBytes()
int
sampleFixedTypeBytes()
int
sampleIidBytes()
abstract int
sampleRmBytes()
int
seedBytes()
The number of random bytes consumed by keygen.int
sharedKeyBytes()
-
-
-
Method Detail
-
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
-
-