Package org.bouncycastle.pqc.math.ntru
Class Polynomial
java.lang.Object
org.bouncycastle.pqc.math.ntru.Polynomial
- Direct Known Subclasses:
HPSPolynomial
,HRSSPolynomial
Polynomial for
org.bouncycastle.pqc.crypto.ntru
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
lift
(Polynomial a) void
mod3PhiN()
void
modQPhiN()
void
r2Inv
(Polynomial a) void
rqInv
(Polynomial a) void
rqMul
(Polynomial a, Polynomial b) void
rqSumZeroFromBytes
(byte[] a) Unpack a Rq0 polynomialbyte[]
rqSumZeroToBytes
(int len) Pack a Rq0 polynomial as a byte arrayvoid
rqToS3
(Polynomial a) void
s3FromBytes
(byte[] msg) Unpack a S3 polynomialvoid
s3Inv
(Polynomial a) void
s3Mul
(Polynomial a, Polynomial b) byte[]
s3ToBytes
(int messageSize) Pack an S3 polynomial as a byte arrayabstract void
sqFromBytes
(byte[] a) Unpack a Sq polynomialvoid
sqMul
(Polynomial a, Polynomial b) abstract byte[]
sqToBytes
(int len) Pack Sq polynomial as a byte arrayvoid
void
z3ToZq()
-
Field Details
-
coeffs
public short[] coeffsAn array of coefficients -
params
-
-
Constructor Details
-
Polynomial
-
-
Method Details
-
mod3PhiN
public void mod3PhiN() -
modQPhiN
public void modQPhiN() -
sqToBytes
public abstract byte[] sqToBytes(int len) Pack Sq polynomial as a byte array- Parameters:
len
- array length of packed polynomial- Returns:
- See Also:
-
sqFromBytes
public abstract void sqFromBytes(byte[] a) Unpack a Sq polynomial- Parameters:
a
- byte array of packed polynomial- See Also:
-
rqSumZeroToBytes
public byte[] rqSumZeroToBytes(int len) Pack a Rq0 polynomial as a byte array- Parameters:
len
- array length of packed polynomial- Returns:
- See Also:
-
rqSumZeroFromBytes
public void rqSumZeroFromBytes(byte[] a) Unpack a Rq0 polynomial- Parameters:
a
- byte array of packed polynomial- See Also:
-
s3ToBytes
public byte[] s3ToBytes(int messageSize) Pack an S3 polynomial as a byte array- Parameters:
messageSize
- array length of packed polynomial- Returns:
- See Also:
-
s3FromBytes
public void s3FromBytes(byte[] msg) Unpack a S3 polynomial- Parameters:
msg
- byte array of packed polynomial- See Also:
-
sqMul
-
rqMul
-
s3Mul
-
lift
- Parameters:
a
-- See Also:
-
rqToS3
-
r2Inv
-
rqInv
-
s3Inv
-
z3ToZq
public void z3ToZq() -
trinaryZqToZ3
public void trinaryZqToZ3()
-