Class NTRUEncryptionPrivateKeyParameters
java.lang.Object
org.bouncycastle.crypto.params.AsymmetricKeyParameter
org.bouncycastle.pqc.legacy.crypto.ntru.NTRUEncryptionKeyParameters
org.bouncycastle.pqc.legacy.crypto.ntru.NTRUEncryptionPrivateKeyParameters
- All Implemented Interfaces:
CipherParameters
A NtruEncrypt private key is essentially a polynomial named
The inverse of
f
which takes different forms depending on whether product-form polynomials are used,
and on fastP
The inverse of
f
modulo p
is precomputed on initialization.-
Field Summary
FieldsFields inherited from class org.bouncycastle.pqc.legacy.crypto.ntru.NTRUEncryptionKeyParameters
params
-
Constructor Summary
ConstructorsConstructorDescriptionNTRUEncryptionPrivateKeyParameters
(byte[] b, NTRUEncryptionParameters params) Converts a byte array to a polynomialf
and constructs a new private keyReads a polynomialf
from an input stream and constructs a new private keyNTRUEncryptionPrivateKeyParameters
(IntegerPolynomial h, Polynomial t, IntegerPolynomial fp, NTRUEncryptionParameters params) Constructs a new private key from a polynomial -
Method Summary
Modifier and TypeMethodDescriptionboolean
byte[]
Converts the key to a byte arrayint
hashCode()
void
writeTo
(OutputStream os) Writes the key to an output streamMethods inherited from class org.bouncycastle.pqc.legacy.crypto.ntru.NTRUEncryptionKeyParameters
getParameters
Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter
isPrivate
-
Field Details
-
t
-
fp
-
h
-
-
Constructor Details
-
NTRUEncryptionPrivateKeyParameters
public NTRUEncryptionPrivateKeyParameters(IntegerPolynomial h, Polynomial t, IntegerPolynomial fp, NTRUEncryptionParameters params) Constructs a new private key from a polynomial- Parameters:
h
- the public polynomial for the key.t
- the polynomial which determines the key: iffastFp=true
,f=1+3t
; otherwise,f=t
fp
- the inverse off
params
- the NtruEncrypt parameters to use
-
NTRUEncryptionPrivateKeyParameters
public NTRUEncryptionPrivateKeyParameters(byte[] b, NTRUEncryptionParameters params) throws IOException Converts a byte array to a polynomialf
and constructs a new private key- Parameters:
b
- an encoded polynomialparams
- the NtruEncrypt parameters to use- Throws:
IOException
- See Also:
-
NTRUEncryptionPrivateKeyParameters
public NTRUEncryptionPrivateKeyParameters(InputStream is, NTRUEncryptionParameters params) throws IOException Reads a polynomialf
from an input stream and constructs a new private key- Parameters:
is
- an input streamparams
- the NtruEncrypt parameters to use- Throws:
IOException
- See Also:
-
-
Method Details
-
getEncoded
public byte[] getEncoded()Converts the key to a byte array- Returns:
- the encoded key
- See Also:
-
writeTo
Writes the key to an output stream- Parameters:
os
- an output stream- Throws:
IOException
- See Also:
-
hashCode
public int hashCode() -
equals
-