Package org.bouncycastle.pqc.crypto.ntru
Class NTRUSigningKeyGenerationParameters
- java.lang.Object
-
- org.bouncycastle.crypto.KeyGenerationParameters
-
- org.bouncycastle.pqc.crypto.ntru.NTRUSigningKeyGenerationParameters
-
- All Implemented Interfaces:
java.lang.Cloneable
public class NTRUSigningKeyGenerationParameters extends KeyGenerationParameters implements java.lang.Cloneable
A set of parameters for NtruSign. Several predefined parameter sets are available and new ones can be created as well.
-
-
Field Summary
Fields Modifier and Type Field Description static NTRUSigningKeyGenerationParametersAPR2011_439Gives 128 bits of securitystatic NTRUSigningKeyGenerationParametersAPR2011_439_PRODLikeAPR2011_439, this parameter set gives 128 bits of security but uses product-form polynomialsstatic NTRUSigningKeyGenerationParametersAPR2011_743Gives 256 bits of securitystatic NTRUSigningKeyGenerationParametersAPR2011_743_PRODLikeAPR2011_439, this parameter set gives 256 bits of security but uses product-form polynomialsintBstatic intBASIS_TYPE_STANDARDstatic intBASIS_TYPE_TRANSPOSEintbasisTypedoublebetaSqintdintd1intd2intd3DigesthashAlgstatic intKEY_GEN_ALG_FLOATstatic intKEY_GEN_ALG_RESULTANTintkeyGenAlgdoublekeyNormBoundSqintNdoublenormBoundSqintpolyTypebooleanprimeCheckintqintsignFailTolerancebooleansparsestatic NTRUSigningKeyGenerationParametersTEST157Generates key pairs quickly.static NTRUSigningKeyGenerationParametersTEST157_PRODGenerates key pairs quickly.
-
Constructor Summary
Constructors Constructor Description 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.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.NTRUSigningKeyGenerationParameters(java.io.InputStream is)Reads a parameter set from an input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NTRUSigningKeyGenerationParametersclone()booleanequals(java.lang.Object obj)NTRUSigningParametersgetSigningParameters()inthashCode()java.lang.StringtoString()voidwriteTo(java.io.OutputStream os)Writes the parameter set to an output stream-
Methods inherited from class org.bouncycastle.crypto.KeyGenerationParameters
getRandom, getStrength
-
-
-
-
Field Detail
-
BASIS_TYPE_STANDARD
public static final int BASIS_TYPE_STANDARD
- See Also:
- Constant Field Values
-
BASIS_TYPE_TRANSPOSE
public static final int BASIS_TYPE_TRANSPOSE
- See Also:
- Constant Field Values
-
KEY_GEN_ALG_RESULTANT
public static final int KEY_GEN_ALG_RESULTANT
- See Also:
- Constant Field Values
-
KEY_GEN_ALG_FLOAT
public static final int KEY_GEN_ALG_FLOAT
- See Also:
- Constant Field Values
-
APR2011_439
public static final NTRUSigningKeyGenerationParameters APR2011_439
Gives 128 bits of security
-
APR2011_439_PROD
public static final NTRUSigningKeyGenerationParameters APR2011_439_PROD
LikeAPR2011_439, this parameter set gives 128 bits of security but uses product-form polynomials
-
APR2011_743
public static final NTRUSigningKeyGenerationParameters APR2011_743
Gives 256 bits of security
-
APR2011_743_PROD
public static final NTRUSigningKeyGenerationParameters APR2011_743_PROD
LikeAPR2011_439, this parameter set gives 256 bits of security but uses product-form polynomials
-
TEST157
public static final NTRUSigningKeyGenerationParameters TEST157
Generates key pairs quickly. Use for testing only.
-
TEST157_PROD
public static final NTRUSigningKeyGenerationParameters 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
public Digest hashAlg
-
polyType
public int polyType
-
-
Constructor Detail
-
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 polynomialsfandgB- 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 ploynomialsFandGprimeCheck- whether2N+1is primesparse- whether to treat ternary polynomials as sparsely populated (SparseTernaryPolynomialvsDenseTernaryPolynomial)keyGenAlg-RESULTANTproduces better bases,FLOATis slightly faster.RESULTANTfollows the EESS standard whileFLOATis described in Hoffstein et al: An Introduction to Mathematical Cryptography.hashAlg- a valid identifier for ajava.security.MessageDigestinstance such asSHA-256. TheMessageDigestmust 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 polynomialsfandgd2- number of -1's in the private polynomialsfandgd3- number of -1's in the private polynomialsfandgB- 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 ploynomialsFandGprimeCheck- whether2N+1is primesparse- whether to treat ternary polynomials as sparsely populated (SparseTernaryPolynomialvsDenseTernaryPolynomial)keyGenAlg-RESULTANTproduces better bases,FLOATis slightly faster.RESULTANTfollows the EESS standard whileFLOATis described in Hoffstein et al: An Introduction to Mathematical Cryptography.hashAlg- a valid identifier for ajava.security.MessageDigestinstance such asSHA-256. TheMessageDigestmust support thegetDigestLength()method.
-
NTRUSigningKeyGenerationParameters
public NTRUSigningKeyGenerationParameters(java.io.InputStream is) throws java.io.IOExceptionReads a parameter set from an input stream.- Parameters:
is- an input stream- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public void writeTo(java.io.OutputStream os) throws java.io.IOExceptionWrites the parameter set to an output stream- Parameters:
os- an output stream- Throws:
java.io.IOException
-
getSigningParameters
public NTRUSigningParameters getSigningParameters()
-
clone
public NTRUSigningKeyGenerationParameters clone()
- Overrides:
clonein classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-