Top Description Fields Constructors Methods
org.bouncycastle.pqc.legacy.math.ntru.polynomial

public Class LongPolynomial5

extends Object
Class Inheritance
Imports
org.bouncycastle.util.Arrays

A polynomial class that combines five coefficients into one long value for faster multiplication by a ternary polynomial.
Coefficients can be between 0 and 2047 and are stored in bits 0..11, 12..23, ..., 48..59 of a long number.

Field Summary

Modifier and TypeField and Description
private long[]
private int

Constructor Summary

AccessConstructor and Description
public
LongPolynomial5(IntegerPolynomial
the original polynomial. Coefficients must be between 0 and 2047.
p
)

Constructs a LongPolynomial5 from a IntegerPolynomial.

private
LongPolynomial5(long[] coeffs, int numCoeffs)

Method Summary

Modifier and TypeMethod and Description
public LongPolynomial5
mult(TernaryPolynomial poly2)

Multiplies the polynomial with a TernaryPolynomial, taking the indices mod N and the values mod 2048.

public IntegerPolynomial
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

coeffsback to summary
private long[] coeffs
numCoeffsback to summary
private int numCoeffs

Constructor Detail

LongPolynomial5back to summary
public LongPolynomial5(IntegerPolynomial p)

Constructs a LongPolynomial5 from a IntegerPolynomial. The two polynomials are independent of each other.

Parameters
p:IntegerPolynomial

the original polynomial. Coefficients must be between 0 and 2047.

LongPolynomial5back to summary
private LongPolynomial5(long[] coeffs, int numCoeffs)

Method Detail

multback to summary
public LongPolynomial5 mult(TernaryPolynomial poly2)

Multiplies the polynomial with a TernaryPolynomial, taking the indices mod N and the values mod 2048.

toIntegerPolynomialback to summary
public IntegerPolynomial toIntegerPolynomial()