Class NTRUParameterSet
java.lang.Object
org.bouncycastle.pqc.math.ntru.parameters.NTRUParameterSet
- Direct Known Subclasses:
NTRUHPSParameterSet
,NTRUHRSSParameterSet
Abstract class for all NTRU parameter sets.
- See Also:
-
Constructor Summary
ConstructorDescriptionNTRUParameterSet
(int n, int logQ, int seedBytes, int prfKeyBytes, int sharedKeyBytes) -
Method Summary
Modifier and TypeMethodDescriptionabstract Polynomial
Creates a polynomial based on this parameter set.int
logQ()
logqint
n()
nint
The number of bytes in a ciphertext for the KEM.int
The number of bytes in a public key for the KEM.int
The number of bytes in a private key for the KEM.int
The number of bytes in a ciphertext for the DPKE.int
The number of bytes in a plaintext for the DPKE.int
The number of bytes in a public key for the DPKE.int
The number of bytes in a private key for the DPKE.int
int
int
The number of bytes used to key the implicit rejection mechanism.int
q()
qabstract int
int
int
abstract int
int
The number of random bytes consumed by keygen.int
-
Constructor Details
-
NTRUParameterSet
public NTRUParameterSet(int n, int logQ, int seedBytes, int prfKeyBytes, int sharedKeyBytes)
-
-
Method Details
-
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
-
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
-