public class NTRUEncryptionParameters
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
int |
bufferLenBits |
int |
c |
int |
db |
int |
df |
int |
df1 |
int |
df2 |
int |
df3 |
int |
dg |
int |
dm0 |
int |
dr |
int |
dr1 |
int |
dr2 |
int |
dr3 |
boolean |
fastFp |
Digest |
hashAlg |
boolean |
hashSeed |
int |
maxMsgLenBytes |
int |
minCallsMask |
int |
minCallsR |
int |
N |
byte[] |
oid |
int |
pkLen |
int |
polyType |
int |
q |
boolean |
sparse |
Constructor and Description |
---|
NTRUEncryptionParameters(java.io.InputStream is)
Reads a parameter set from an input stream.
|
NTRUEncryptionParameters(int N,
int q,
int df,
int dm0,
int db,
int c,
int minCallsR,
int minCallsMask,
boolean hashSeed,
byte[] oid,
boolean sparse,
boolean fastFp,
Digest hashAlg)
Constructs a parameter set that uses ternary private keys (i.e.
|
NTRUEncryptionParameters(int N,
int q,
int df1,
int df2,
int df3,
int dm0,
int db,
int c,
int minCallsR,
int minCallsMask,
boolean hashSeed,
byte[] oid,
boolean sparse,
boolean fastFp,
Digest hashAlg)
Constructs a parameter set that uses product-form private keys (i.e.
|
Modifier and Type | Method and Description |
---|---|
NTRUEncryptionParameters |
clone() |
boolean |
equals(java.lang.Object obj) |
int |
getMaxMessageLength()
Returns the maximum length a plaintext message can be with this parameter set.
|
int |
hashCode() |
java.lang.String |
toString() |
void |
writeTo(java.io.OutputStream os)
Writes the parameter set to an output stream
|
public int N
public int q
public int df
public int df1
public int df2
public int df3
public int dr
public int dr1
public int dr2
public int dr3
public int dg
public int maxMsgLenBytes
public int db
public int bufferLenBits
public int dm0
public int pkLen
public int c
public int minCallsR
public int minCallsMask
public boolean hashSeed
public byte[] oid
public boolean sparse
public boolean fastFp
public int polyType
public Digest hashAlg
public NTRUEncryptionParameters(int N, int q, int df, int dm0, int db, int c, int minCallsR, int minCallsMask, boolean hashSeed, byte[] oid, boolean sparse, boolean fastFp, Digest hashAlg)
polyType=SIMPLE
).N
- number of polynomial coefficientsq
- modulusdf
- number of ones in the private polynomial f
dm0
- minimum acceptable number of -1's, 0's, and 1's in the polynomial m'
in the last encryption stepdb
- number of random bits to prepend to the messagec
- a parameter for the Index Generation Function (IndexGenerator
)minCallsR
- minimum number of hash calls for the IGF to makeminCallsMask
- minimum number of calls to generate the masking polynomialhashSeed
- whether to hash the seed in the MGF first (true) or use the seed directly (false)oid
- three bytes that uniquely identify the parameter setsparse
- whether to treat ternary polynomials as sparsely populated (SparseTernaryPolynomial
vs DenseTernaryPolynomial
)fastFp
- whether f=1+p*F
for a ternary F
(true) or f
is ternary (false)hashAlg
- a valid identifier for a java.security.MessageDigest
instance such as SHA-256
. The MessageDigest
must support the getDigestLength()
method.public NTRUEncryptionParameters(int N, int q, int df1, int df2, int df3, int dm0, int db, int c, int minCallsR, int minCallsMask, boolean hashSeed, byte[] oid, boolean sparse, boolean fastFp, Digest hashAlg)
polyType=PRODUCT
).N
- number of polynomial coefficientsq
- modulusdf1
- number of ones in the private polynomial f1
df2
- number of ones in the private polynomial f2
df3
- number of ones in the private polynomial f3
dm0
- minimum acceptable number of -1's, 0's, and 1's in the polynomial m'
in the last encryption stepdb
- number of random bits to prepend to the messagec
- a parameter for the Index Generation Function (IndexGenerator
)minCallsR
- minimum number of hash calls for the IGF to makeminCallsMask
- minimum number of calls to generate the masking polynomialhashSeed
- whether to hash the seed in the MGF first (true) or use the seed directly (false)oid
- three bytes that uniquely identify the parameter setsparse
- whether to treat ternary polynomials as sparsely populated (SparseTernaryPolynomial
vs DenseTernaryPolynomial
)fastFp
- whether f=1+p*F
for a ternary F
(true) or f
is ternary (false)hashAlg
- a valid identifier for a java.security.MessageDigest
instance such as SHA-256
public NTRUEncryptionParameters(java.io.InputStream is) throws java.io.IOException
is
- an input streamjava.io.IOException
public NTRUEncryptionParameters clone()
clone
in class java.lang.Object
public int getMaxMessageLength()
public void writeTo(java.io.OutputStream os) throws java.io.IOException
os
- an output streamjava.io.IOException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object