|
Bouncy Castle Cryptography 1.50 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.bouncycastle.pqc.math.linearalgebra.PolynomialGF2mSmallM
public class PolynomialGF2mSmallM
This class describes operations with polynomials from the ring R = GF(2^m)[X], where 2 <= m <=31.
GF2mField,
PolynomialRingGF2m| Field Summary | |
|---|---|
static char |
RANDOM_IRREDUCIBLE_POLYNOMIAL
Constant used for polynomial construction (see constructor PolynomialGF2mSmallM(GF2mField, int, char, SecureRandom)). |
| Constructor Summary | |
|---|---|
PolynomialGF2mSmallM(GF2mField field)
Construct the zero polynomial over the finite field GF(2^m). |
|
PolynomialGF2mSmallM(GF2mField field,
byte[] enc)
Create a polynomial over the finite field GF(2^m). |
|
PolynomialGF2mSmallM(GF2mField field,
int degree)
Construct a monomial of the given degree over the finite field GF(2^m). |
|
PolynomialGF2mSmallM(GF2mField field,
int[] coeffs)
Construct the polynomial over the given finite field GF(2^m) from the given coefficient vector. |
|
PolynomialGF2mSmallM(GF2mField field,
int deg,
char typeOfPolynomial,
java.security.SecureRandom sr)
Construct a polynomial over the finite field GF(2^m). |
|
PolynomialGF2mSmallM(GF2mVector vect)
Create a polynomial over the finite field GF(2^m) out of the given coefficient vector. |
|
PolynomialGF2mSmallM(PolynomialGF2mSmallM other)
Copy constructor. |
|
| Method Summary | |
|---|---|
PolynomialGF2mSmallM |
add(PolynomialGF2mSmallM addend)
Compute the sum of this polynomial and the given polynomial. |
PolynomialGF2mSmallM |
addMonomial(int degree)
Compute the sum of this polynomial and the monomial of the given degree. |
void |
addToThis(PolynomialGF2mSmallM addend)
Add the given polynomial to this polynomial (overwrite this). |
PolynomialGF2mSmallM[] |
div(PolynomialGF2mSmallM f)
Divide this polynomial by the given polynomial. |
boolean |
equals(java.lang.Object other)
checks if given object is equal to this polynomial. |
int |
evaluateAt(int e)
Evaluate this polynomial p at a value e (in GF(2^m)) with the Horner scheme. |
PolynomialGF2mSmallM |
gcd(PolynomialGF2mSmallM f)
Return the greatest common divisor of this and a polynomial f |
int |
getCoefficient(int index)
Return the coefficient with the given index. |
int |
getDegree()
Return the degree of this polynomial |
byte[] |
getEncoded()
Returns encoded polynomial, i.e., this polynomial in byte array form |
int |
getHeadCoefficient()
|
int |
hashCode()
|
PolynomialGF2mSmallM |
mod(PolynomialGF2mSmallM f)
Reduce this polynomial modulo another polynomial. |
PolynomialGF2mSmallM |
modDiv(PolynomialGF2mSmallM divisor,
PolynomialGF2mSmallM modulus)
Compute the result of the division of this polynomial by another polynomial modulo a third polynomial. |
PolynomialGF2mSmallM |
modInverse(PolynomialGF2mSmallM a)
Compute the inverse of this polynomial modulo the given polynomial. |
PolynomialGF2mSmallM |
modMultiply(PolynomialGF2mSmallM a,
PolynomialGF2mSmallM b)
Compute the product of this polynomial and another polynomial modulo a third polynomial. |
PolynomialGF2mSmallM[] |
modPolynomialToFracton(PolynomialGF2mSmallM g)
Compute a polynomial pair (a,b) from this polynomial and the given polynomial g with the property b*this = a mod g and deg(a)<=deg(g)/2. |
PolynomialGF2mSmallM |
modSquareMatrix(PolynomialGF2mSmallM[] matrix)
Square this polynomial using a squaring matrix. |
PolynomialGF2mSmallM |
modSquareRoot(PolynomialGF2mSmallM a)
Compute the square root of this polynomial modulo the given polynomial. |
PolynomialGF2mSmallM |
modSquareRootMatrix(PolynomialGF2mSmallM[] matrix)
Compute the square root of this polynomial using a square root matrix. |
PolynomialGF2mSmallM |
multiply(PolynomialGF2mSmallM factor)
Compute the product of this polynomial and the given factor using a Karatzuba like scheme. |
void |
multThisWithElement(int element)
Multiply this polynomial with an element from GF(2^m). |
PolynomialGF2mSmallM |
multWithElement(int element)
Compute the product of this polynomial with an element from GF(2^m). |
PolynomialGF2mSmallM |
multWithMonomial(int k)
Compute the product of this polynomial with a monomial X^k. |
java.lang.String |
toString()
Returns a human readable form of the polynomial. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final char RANDOM_IRREDUCIBLE_POLYNOMIAL
PolynomialGF2mSmallM(GF2mField, int, char, SecureRandom)).
| Constructor Detail |
|---|
public PolynomialGF2mSmallM(GF2mField field)
field - the finite field GF(2^m)
public PolynomialGF2mSmallM(GF2mField field,
int deg,
char typeOfPolynomial,
java.security.SecureRandom sr)
field - the finite field GF(2^m)deg - degree of polynomialtypeOfPolynomial - type of polynomialsr - PRNG
public PolynomialGF2mSmallM(GF2mField field,
int degree)
field - the finite field GF(2^m)degree - the degree of the monomial
public PolynomialGF2mSmallM(GF2mField field,
int[] coeffs)
field - finite field GF2mcoeffs - the coefficient vector
public PolynomialGF2mSmallM(GF2mField field,
byte[] enc)
field - the finite field GF(2^m)enc - byte[] polynomial in byte array formpublic PolynomialGF2mSmallM(PolynomialGF2mSmallM other)
other - another PolynomialGF2mSmallMpublic PolynomialGF2mSmallM(GF2mVector vect)
GF2mVector.
vect - the coefficient vector| Method Detail |
|---|
public int getDegree()
public int getHeadCoefficient()
public int getCoefficient(int index)
index - the index
public byte[] getEncoded()
public int evaluateAt(int e)
e - the element of the finite field GF(2^m)
public PolynomialGF2mSmallM add(PolynomialGF2mSmallM addend)
addend - the addend
public void addToThis(PolynomialGF2mSmallM addend)
addend - the addendpublic PolynomialGF2mSmallM addMonomial(int degree)
degree - the degree of the monomial
public PolynomialGF2mSmallM multWithElement(int element)
element - an element of the finite field GF(2^m)
java.lang.ArithmeticException - if element is not an element of the finite
field this polynomial is defined over.public void multThisWithElement(int element)
element - an element of the finite field GF(2^m)
java.lang.ArithmeticException - if element is not an element of the finite
field this polynomial is defined over.public PolynomialGF2mSmallM multWithMonomial(int k)
k - the degree of the monomial
public PolynomialGF2mSmallM[] div(PolynomialGF2mSmallM f)
f - a polynomial
public PolynomialGF2mSmallM gcd(PolynomialGF2mSmallM f)
f - polynomial
public PolynomialGF2mSmallM multiply(PolynomialGF2mSmallM factor)
factor - the polynomial
public PolynomialGF2mSmallM mod(PolynomialGF2mSmallM f)
f - the reduction polynomial
public PolynomialGF2mSmallM modMultiply(PolynomialGF2mSmallM a,
PolynomialGF2mSmallM b)
a - another polynomialb - the reduction polynomial
public PolynomialGF2mSmallM modSquareMatrix(PolynomialGF2mSmallM[] matrix)
matrix - the squaring matrix
public PolynomialGF2mSmallM modSquareRoot(PolynomialGF2mSmallM a)
a - the reduction polynomial
public PolynomialGF2mSmallM modSquareRootMatrix(PolynomialGF2mSmallM[] matrix)
matrix - the matrix for computing square roots in
(GF(2^m))^t the polynomial ring defining the
square root matrix
public PolynomialGF2mSmallM modDiv(PolynomialGF2mSmallM divisor,
PolynomialGF2mSmallM modulus)
divisor - the divisormodulus - the reduction polynomial
public PolynomialGF2mSmallM modInverse(PolynomialGF2mSmallM a)
a - the reduction polynomial
public PolynomialGF2mSmallM[] modPolynomialToFracton(PolynomialGF2mSmallM g)
g - the reduction polynomial
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - object
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
Bouncy Castle Cryptography 1.50 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||