public class NTRUEncryptionPrivateKeyParameters extends NTRUEncryptionKeyParameters
f
which takes different forms depending on whether product-form polynomials are used,
and on fastP
f
modulo p
is precomputed on initialization.Modifier and Type | Field and Description |
---|---|
IntegerPolynomial |
fp |
IntegerPolynomial |
h |
Polynomial |
t |
params
Constructor and Description |
---|
NTRUEncryptionPrivateKeyParameters(byte[] b,
NTRUEncryptionParameters params)
Converts a byte array to a polynomial
f and constructs a new private key |
NTRUEncryptionPrivateKeyParameters(InputStream is,
NTRUEncryptionParameters params)
Reads a polynomial
f from an input stream and constructs a new private key |
NTRUEncryptionPrivateKeyParameters(IntegerPolynomial h,
Polynomial t,
IntegerPolynomial fp,
NTRUEncryptionParameters params)
Constructs a new private key from a polynomial
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
byte[] |
getEncoded()
Converts the key to a byte array
|
int |
hashCode() |
void |
writeTo(OutputStream os)
Writes the key to an output stream
|
getParameters
isPrivate
public Polynomial t
public IntegerPolynomial fp
public IntegerPolynomial h
public NTRUEncryptionPrivateKeyParameters(IntegerPolynomial h, Polynomial t, IntegerPolynomial fp, NTRUEncryptionParameters params)
h
- the public polynomial for the key.t
- the polynomial which determines the key: if fastFp=true
, f=1+3t
; otherwise, f=t
fp
- the inverse of f
params
- the NtruEncrypt parameters to usepublic NTRUEncryptionPrivateKeyParameters(byte[] b, NTRUEncryptionParameters params) throws IOException
f
and constructs a new private keyb
- an encoded polynomialparams
- the NtruEncrypt parameters to useIOException
getEncoded()
public NTRUEncryptionPrivateKeyParameters(InputStream is, NTRUEncryptionParameters params) throws IOException
f
from an input stream and constructs a new private keyis
- an input streamparams
- the NtruEncrypt parameters to useIOException
writeTo(OutputStream)
public byte[] getEncoded()
NTRUEncryptionPrivateKeyParameters(byte[], NTRUEncryptionParameters)
public void writeTo(OutputStream os) throws IOException
os
- an output streamIOException
NTRUEncryptionPrivateKeyParameters(InputStream, NTRUEncryptionParameters)
Copyright © 2021 BouncyCastle.org. All rights reserved.