public class PolynomialGF2mSmallM
extends java.lang.Object
GF2mField
,
PolynomialRingGF2m
Modifier and Type | Field and Description |
---|---|
static char |
RANDOM_IRREDUCIBLE_POLYNOMIAL
Constant used for polynomial construction (see constructor
PolynomialGF2mSmallM(GF2mField, int, char, SecureRandom) ). |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final char RANDOM_IRREDUCIBLE_POLYNOMIAL
PolynomialGF2mSmallM(GF2mField, int, char, SecureRandom)
).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
- PRNGpublic PolynomialGF2mSmallM(GF2mField field, int degree)
field
- the finite field GF(2^m)degree
- the degree of the monomialpublic PolynomialGF2mSmallM(GF2mField field, int[] coeffs)
field
- finite field GF2mcoeffs
- the coefficient vectorpublic PolynomialGF2mSmallM(GF2mField field, byte[] enc)
field
- the finite field GF(2^m)enc
- byte[] polynomial in byte array formpublic PolynomialGF2mSmallM(PolynomialGF2mSmallM other)
other
- another PolynomialGF2mSmallM
public PolynomialGF2mSmallM(GF2mVector vect)
GF2mVector
.vect
- the coefficient vectorpublic int getDegree()
public int getHeadCoefficient()
public int getCoefficient(int index)
index
- the indexpublic byte[] getEncoded()
public int evaluateAt(int e)
e
- the element of the finite field GF(2^m)public PolynomialGF2mSmallM add(PolynomialGF2mSmallM addend)
addend
- the addendpublic void addToThis(PolynomialGF2mSmallM addend)
addend
- the addendpublic PolynomialGF2mSmallM addMonomial(int degree)
degree
- the degree of the monomialpublic 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 monomialpublic PolynomialGF2mSmallM[] div(PolynomialGF2mSmallM f)
f
- a polynomialpublic PolynomialGF2mSmallM gcd(PolynomialGF2mSmallM f)
f
- polynomialpublic PolynomialGF2mSmallM multiply(PolynomialGF2mSmallM factor)
factor
- the polynomialpublic PolynomialGF2mSmallM mod(PolynomialGF2mSmallM f)
f
- the reduction polynomialpublic PolynomialGF2mSmallM modMultiply(PolynomialGF2mSmallM a, PolynomialGF2mSmallM b)
a
- another polynomialb
- the reduction polynomialpublic PolynomialGF2mSmallM modSquareMatrix(PolynomialGF2mSmallM[] matrix)
matrix
- the squaring matrixpublic PolynomialGF2mSmallM modSquareRoot(PolynomialGF2mSmallM a)
a
- the reduction polynomialpublic PolynomialGF2mSmallM modSquareRootMatrix(PolynomialGF2mSmallM[] matrix)
matrix
- the matrix for computing square roots in
(GF(2^m))^t the polynomial ring defining the
square root matrixpublic PolynomialGF2mSmallM modDiv(PolynomialGF2mSmallM divisor, PolynomialGF2mSmallM modulus)
divisor
- the divisormodulus
- the reduction polynomialpublic PolynomialGF2mSmallM modInverse(PolynomialGF2mSmallM a)
a
- the reduction polynomialpublic PolynomialGF2mSmallM[] modPolynomialToFracton(PolynomialGF2mSmallM g)
g
- the reduction polynomialpublic boolean equals(java.lang.Object other)
The method returns false whenever the given object is not polynomial over GF(2^m).
equals
in class java.lang.Object
other
- objectpublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object