Package org.bouncycastle.pqc.math.ntru
Class Polynomial
- java.lang.Object
-
- org.bouncycastle.pqc.math.ntru.Polynomial
-
- Direct Known Subclasses:
HPSPolynomial
,HRSSPolynomial
public abstract class Polynomial extends java.lang.Object
Polynomial fororg.bouncycastle.pqc.crypto.ntru
.
-
-
Field Summary
Fields Modifier and Type Field Description short[]
coeffs
An array of coefficientsprotected NTRUParameterSet
params
-
Constructor Summary
Constructors Constructor Description Polynomial(NTRUParameterSet params)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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
trinaryZqToZ3()
void
z3ToZq()
-
-
-
Field Detail
-
coeffs
public short[] coeffs
An array of coefficients
-
params
protected NTRUParameterSet params
-
-
Constructor Detail
-
Polynomial
public Polynomial(NTRUParameterSet params)
-
-
Method Detail
-
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:
- NTRU specification section 1.8.5
-
sqFromBytes
public abstract void sqFromBytes(byte[] a)
Unpack a Sq polynomial- Parameters:
a
- byte array of packed polynomial- See Also:
- NTRU specification section 1.8.6
-
rqSumZeroToBytes
public byte[] rqSumZeroToBytes(int len)
Pack a Rq0 polynomial as a byte array- Parameters:
len
- array length of packed polynomial- Returns:
- See Also:
- NTRU specification section 1.8.3
-
rqSumZeroFromBytes
public void rqSumZeroFromBytes(byte[] a)
Unpack a Rq0 polynomial- Parameters:
a
- byte array of packed polynomial- See Also:
- NTRU specification section 1.8.4
-
s3ToBytes
public byte[] s3ToBytes(int messageSize)
Pack an S3 polynomial as a byte array- Parameters:
messageSize
- array length of packed polynomial- Returns:
- See Also:
- NTRU specification section 1.8.7
-
s3FromBytes
public void s3FromBytes(byte[] msg)
Unpack a S3 polynomial- Parameters:
msg
- byte array of packed polynomial- See Also:
- NTRU specification section 1.8.8
-
sqMul
public void sqMul(Polynomial a, Polynomial b)
-
rqMul
public void rqMul(Polynomial a, Polynomial b)
-
s3Mul
public void s3Mul(Polynomial a, Polynomial b)
-
lift
public abstract void lift(Polynomial a)
- Parameters:
a
-- See Also:
- NTRU specification section 1.9.3
-
rqToS3
public void rqToS3(Polynomial a)
-
r2Inv
public void r2Inv(Polynomial a)
-
rqInv
public void rqInv(Polynomial a)
-
s3Inv
public void s3Inv(Polynomial a)
-
z3ToZq
public void z3ToZq()
-
trinaryZqToZ3
public void trinaryZqToZ3()
-
-