Class NTRUSigningKeyGenerationParameters
java.lang.Object
org.bouncycastle.crypto.KeyGenerationParameters
org.bouncycastle.pqc.legacy.crypto.ntru.NTRUSigningKeyGenerationParameters
- All Implemented Interfaces:
Cloneable
public class NTRUSigningKeyGenerationParameters
extends KeyGenerationParameters
implements Cloneable
A set of parameters for NtruSign. Several predefined parameter sets are available and new ones can be created as well.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NTRUSigningKeyGenerationParameters
Gives 128 bits of securitystatic final NTRUSigningKeyGenerationParameters
LikeAPR2011_439
, this parameter set gives 128 bits of security but uses product-form polynomialsstatic final NTRUSigningKeyGenerationParameters
Gives 256 bits of securitystatic final NTRUSigningKeyGenerationParameters
LikeAPR2011_439
, this parameter set gives 256 bits of security but uses product-form polynomialsint
static final int
static final int
int
double
int
int
int
int
static final int
static final int
int
double
int
double
int
boolean
int
int
boolean
static final NTRUSigningKeyGenerationParameters
Generates key pairs quickly.static final NTRUSigningKeyGenerationParameters
Generates key pairs quickly. -
Constructor Summary
ConstructorsConstructorDescriptionNTRUSigningKeyGenerationParameters
(int N, int q, int d, int B, int basisType, double beta, double normBound, double keyNormBound, boolean primeCheck, boolean sparse, int keyGenAlg, Digest hashAlg) Constructs a parameter set that uses ternary private keys (i.e.NTRUSigningKeyGenerationParameters
(int N, int q, int d1, int d2, int d3, int B, int basisType, double beta, double normBound, double keyNormBound, boolean primeCheck, boolean sparse, int keyGenAlg, Digest hashAlg) Constructs a parameter set that uses product-form private keys (i.e.Reads a parameter set from an input stream. -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
int
hashCode()
toString()
void
writeTo
(OutputStream os) Writes the parameter set to an output streamMethods inherited from class org.bouncycastle.crypto.KeyGenerationParameters
getRandom, getStrength
-
Field Details
-
BASIS_TYPE_STANDARD
public static final int BASIS_TYPE_STANDARD- See Also:
-
BASIS_TYPE_TRANSPOSE
public static final int BASIS_TYPE_TRANSPOSE- See Also:
-
KEY_GEN_ALG_RESULTANT
public static final int KEY_GEN_ALG_RESULTANT- See Also:
-
KEY_GEN_ALG_FLOAT
public static final int KEY_GEN_ALG_FLOAT- See Also:
-
APR2011_439
Gives 128 bits of security -
APR2011_439_PROD
LikeAPR2011_439
, this parameter set gives 128 bits of security but uses product-form polynomials -
APR2011_743
Gives 256 bits of security -
APR2011_743_PROD
LikeAPR2011_439
, this parameter set gives 256 bits of security but uses product-form polynomials -
TEST157
Generates key pairs quickly. Use for testing only. -
TEST157_PROD
Generates key pairs quickly. Use for testing only. -
N
public int N -
q
public int q -
d
public int d -
d1
public int d1 -
d2
public int d2 -
d3
public int d3 -
B
public int B -
betaSq
public double betaSq -
normBoundSq
public double normBoundSq -
signFailTolerance
public int signFailTolerance -
keyNormBoundSq
public double keyNormBoundSq -
primeCheck
public boolean primeCheck -
basisType
public int basisType -
sparse
public boolean sparse -
keyGenAlg
public int keyGenAlg -
hashAlg
-
polyType
public int polyType
-
-
Constructor Details
-
NTRUSigningKeyGenerationParameters
public NTRUSigningKeyGenerationParameters(int N, int q, int d, int B, int basisType, double beta, double normBound, double keyNormBound, boolean primeCheck, boolean sparse, int keyGenAlg, Digest hashAlg) Constructs a parameter set that uses ternary private keys (i.e.polyType=SIMPLE
).- Parameters:
N
- number of polynomial coefficientsq
- modulusd
- number of -1's in the private polynomialsf
andg
B
- number of perturbationsbasisType
- whether to use the standard or transpose latticebeta
- balancing factor for the transpose latticenormBound
- maximum norm for valid signatureskeyNormBound
- maximum norm for the ploynomialsF
andG
primeCheck
- whether2N+1
is primesparse
- whether to treat ternary polynomials as sparsely populated (SparseTernaryPolynomial
vsDenseTernaryPolynomial
)keyGenAlg
-RESULTANT
produces better bases,FLOAT
is slightly faster.RESULTANT
follows the EESS standard whileFLOAT
is described in Hoffstein et al: An Introduction to Mathematical Cryptography.hashAlg
- a valid identifier for ajava.security.MessageDigest
instance such asSHA-256
. TheMessageDigest
must support thegetDigestLength()
method.
-
NTRUSigningKeyGenerationParameters
public NTRUSigningKeyGenerationParameters(int N, int q, int d1, int d2, int d3, int B, int basisType, double beta, double normBound, double keyNormBound, boolean primeCheck, boolean sparse, int keyGenAlg, Digest hashAlg) Constructs a parameter set that uses product-form private keys (i.e.polyType=PRODUCT
).- Parameters:
N
- number of polynomial coefficientsq
- modulusd1
- number of -1's in the private polynomialsf
andg
d2
- number of -1's in the private polynomialsf
andg
d3
- number of -1's in the private polynomialsf
andg
B
- number of perturbationsbasisType
- whether to use the standard or transpose latticebeta
- balancing factor for the transpose latticenormBound
- maximum norm for valid signatureskeyNormBound
- maximum norm for the ploynomialsF
andG
primeCheck
- whether2N+1
is primesparse
- whether to treat ternary polynomials as sparsely populated (SparseTernaryPolynomial
vsDenseTernaryPolynomial
)keyGenAlg
-RESULTANT
produces better bases,FLOAT
is slightly faster.RESULTANT
follows the EESS standard whileFLOAT
is described in Hoffstein et al: An Introduction to Mathematical Cryptography.hashAlg
- a valid identifier for ajava.security.MessageDigest
instance such asSHA-256
. TheMessageDigest
must support thegetDigestLength()
method.
-
NTRUSigningKeyGenerationParameters
Reads a parameter set from an input stream.- Parameters:
is
- an input stream- Throws:
IOException
-
-
Method Details
-
writeTo
Writes the parameter set to an output stream- Parameters:
os
- an output stream- Throws:
IOException
-
getSigningParameters
-
clone
-
hashCode
public int hashCode() -
equals
-
toString
-