GF2mField, PolynomialRingGF2m
| Modifier and Type | Field and Description |
|---|---|
| private int[] | coefficients
For the polynomial representation the map f: R->Z*,
poly(X) -> [coef_0, coef_1, ...] is used, where
coef_i is the ith coefficient of the polynomial
represented as int (see |
| private int | degree
the degree of this polynomial |
| private GF2mField | field
the finite field GF(2^m) |
| public static final char | RANDOM_IRREDUCIBLE_POLYNOMIAL
Constant used for polynomial construction (see constructor
|
| Access | Constructor and Description |
|---|---|
| public | PolynomialGF2mSmallM(GF2mField
the finite field GF(2^m) field)Construct the zero polynomial over the finite field GF(2^m). |
| public | PolynomialGF2mSmallM(GF2mField
the finite field GF(2^m) field, int degree of polynomial deg, char type of polynomial typeOfPolynomial, SecureRandom PRNG sr)Construct a polynomial over the finite field GF(2^m). |
| public | PolynomialGF2mSmallM(GF2mField
the finite field GF(2^m) field, int the degree of the monomial degree)Construct a monomial of the given degree over the finite field GF(2^m). |
| public | PolynomialGF2mSmallM(GF2mField
finite field GF2m field, int[] the coefficient vector coeffs)Construct the polynomial over the given finite field GF(2^m) from the given coefficient vector. |
| public | PolynomialGF2mSmallM(GF2mField
the finite field GF(2^m) field, byte[] byte[] polynomial in byte array form enc)Create a polynomial over the finite field GF(2^m). |
| public | |
| public | PolynomialGF2mSmallM(GF2mVector
the coefficient vector vect)Create a polynomial over the finite field GF(2^m) out of the given coefficient vector. |
| Modifier and Type | Method and Description |
|---|---|
| public PolynomialGF2mSmallM | Returns: this + a (newly created)the addend addend)Compute the sum of this polynomial and the given polynomial. |
| private int[] | Returns: a + bthe first polynomial a, int[] the second polynomial b)Compute the sum of two polynomials a and b over the finite field GF(2^m). |
| public PolynomialGF2mSmallM | Returns: this + X^kthe degree of the monomial degree)Compute the sum of this polynomial and the monomial of the given degree. |
| public void | addToThis(PolynomialGF2mSmallM
the addend addend)Add the given polynomial to this polynomial (overwrite this). |
| private void | |
| private static int | Returns: the degree of the polynomial a. If a is the zero polynomial, return -1.the polynomial a)Compute the degree of a polynomial. |
| private int[] | Returns: the generated irreducible polynomialpolynomial degree deg, SecureRandom source of randomness sr)Create an irreducible polynomial with the given degree over the field GF(2^m). |
| public PolynomialGF2mSmallM[] | Returns: polynomial pair = {q,r} where this = q*f+r and deg(r) < deg(f);a polynomial f)Divide this polynomial by the given polynomial. |
| private int[][] | Returns: int[][] {q,r}, where a = q*f+r and deg(r) < deg(f);the first polynomial a, int[] the second polynomial f)Compute the result of the division of two polynomials over the field GF(2^m). |
| public boolean | Returns: true or falseobject other)Overrides java. |
| public int | Returns: this(e)the element of the finite field GF(2^m) e)Evaluate this polynomial p at a value e (in GF(2^m)) with the Horner scheme. |
| public PolynomialGF2mSmallM | Returns: GCD(this, f)polynomial f)Return the greatest common divisor of this and a polynomial f |
| private int[] | Returns: gcd(f, g)the first polynomial f, int[] the second polynomial g)Return the greatest common divisor of two polynomials over the field GF(2^m). |
| public int | Returns: the coefficient with the given indexthe index index)Return the coefficient with the given index. |
| public int | Returns: int degree of this polynomial if this is zero polynomial return -1Return the degree of this polynomial |
| public byte[] | Returns: the encoded polynomialReturns encoded polynomial, i.e., this polynomial in byte array form |
| public int | |
| public int | Returns: the hash code of this polynomialOverrides java. |
| private static int | Returns: the head coefficient of athe polynomial a)Return the head coefficient of a polynomial. |
| private static boolean | Returns: true if a and b represent the same polynomials, false otherwisethe first polynomial a, int[] the second polynomial b)Compare two polynomials given as int arrays. |
| private boolean | Returns: true if a is irreducible, false otherwisethe polynomial to check a)Check a polynomial for irreducibility over the field GF(2^m). |
| public PolynomialGF2mSmallM | Returns: this mod fthe reduction polynomial f)Reduce this polynomial modulo another polynomial. |
| private int[] | Returns: a mod fthe polynomial a, int[] the reduction polynomial f)Reduce a polynomial modulo another polynomial. |
| public PolynomialGF2mSmallM | Returns: this * divisor^(-1) mod modulusthe divisor divisor, PolynomialGF2mSmallM the reduction polynomial modulus)Compute the result of the division of this polynomial by another polynomial modulo a third polynomial. |
| private int[] | Returns: a * b^(-1) mod gthe first polynomial a, int[] the second polynomial b, int[] the reduction polynomial g)Compute the result of the division of two polynomials modulo a third polynomial over the field GF(2^m). |
| public PolynomialGF2mSmallM | Returns: this^(-1) mod athe reduction polynomial a)Compute the inverse of this polynomial modulo the given polynomial. |
| public PolynomialGF2mSmallM | Returns: this * a mod banother polynomial a, PolynomialGF2mSmallM the reduction polynomial b)Compute the product of this polynomial and another polynomial modulo a third polynomial. |
| private int[] | Returns: a * b mod gthe first polynomial a, int[] the second polynomial b, int[] the reduction polynomial g)Compute the product of two polynomials modulo a third polynomial over the finite field GF(2^m). |
| public PolynomialGF2mSmallM[] | Returns: PolynomialGF2mSmallM[] {a,b} with b*this = a mod g and deg(a)<= deg(g)/2the reduction polynomial 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. |
| public PolynomialGF2mSmallM | Returns: this^2 modulo the reduction polynomial implicitly given via the squaring matrixthe squaring matrix matrix)Square this polynomial using a squaring matrix. |
| public PolynomialGF2mSmallM | Returns: this^(1/2) mod athe reduction polynomial a)Compute the square root of this polynomial modulo the given polynomial. |
| public PolynomialGF2mSmallM | Returns: this^(1/2) modulo the reduction polynomial implicitly given via the square root matrixthe matrix for computing square roots in
(GF(2^m))^t the polynomial ring defining the
square root matrix matrix)Compute the square root of this polynomial using a square root matrix. |
| public PolynomialGF2mSmallM | Returns: this * factorthe polynomial factor)Compute the product of this polynomial and the given factor using a Karatzuba like scheme. |
| private int[] | Returns: a * bthe first polynomial a, int[] the second polynomial b)Compute the product of two polynomials over the field GF(2^m) using a Karatzuba like multiplication. |
| public void | multThisWithElement(int
an element of the finite field GF(2^m) element)Multiply this polynomial with an element from GF(2^m). |
| public PolynomialGF2mSmallM | Returns: this * element (newly created)an element of the finite field GF(2^m) element)Compute the product of this polynomial with an element from GF(2^m). |
| private int[] | Returns: a * elementthe polynomial a, int an element of the finite field GF(2^m) element)Compute the product of a polynomial a with an element from the finite field GF(2^m). |
| public PolynomialGF2mSmallM | Returns: this * X^kthe degree of the monomial k)Compute the product of this polynomial with a monomial X^k. |
| private static int[] | Returns: a * X^kthe polynomial a, int the degree of the monomial k)Compute the product of a polynomial with a monomial X^k. |
| private static int[] | Returns: the reduced polynomialthe polynomial a)Strip leading zero coefficients from the given polynomial. |
| public String | Returns: a human readable form of the polynomial.Overrides java. |
| coefficients | back to summary |
|---|---|
| private int[] coefficients For the polynomial representation the map f: R->Z*,
poly(X) -> [coef_0, coef_1, ...] is used, where
coef_i is the ith coefficient of the polynomial
represented as int (see | |
| degree | back to summary |
|---|---|
| private int degree the degree of this polynomial | |
| field | back to summary |
|---|---|
| private GF2mField field the finite field GF(2^m) | |
| RANDOM_IRREDUCIBLE_POLYNOMIAL | back to summary |
|---|---|
| public static final char RANDOM_IRREDUCIBLE_POLYNOMIAL Constant used for polynomial construction (see constructor
| |
| PolynomialGF2mSmallM | back to summary |
|---|---|
| public PolynomialGF2mSmallM(GF2mField field) Construct the zero polynomial over the finite field GF(2^m).
| |
| PolynomialGF2mSmallM | back to summary |
|---|---|
| public PolynomialGF2mSmallM(GF2mField field, int deg, char typeOfPolynomial, SecureRandom sr) Construct a polynomial over the finite field GF(2^m).
| |
| PolynomialGF2mSmallM | back to summary |
|---|---|
| public PolynomialGF2mSmallM(GF2mField field, int degree) Construct a monomial of the given degree over the finite field GF(2^m).
| |
| PolynomialGF2mSmallM | back to summary |
|---|---|
| public PolynomialGF2mSmallM(GF2mField field, int[] coeffs) Construct the polynomial over the given finite field GF(2^m) from the given coefficient vector.
| |
| PolynomialGF2mSmallM | back to summary |
|---|---|
| public PolynomialGF2mSmallM(GF2mField field, byte[] enc) Create a polynomial over the finite field GF(2^m).
| |
| PolynomialGF2mSmallM | back to summary |
|---|---|
| public PolynomialGF2mSmallM(PolynomialGF2mSmallM other) Copy constructor.
| |
| PolynomialGF2mSmallM | back to summary |
|---|---|
| public PolynomialGF2mSmallM(GF2mVector vect) Create a polynomial over the finite field GF(2^m) out of the given
coefficient vector. The finite field is also obtained from the
| |
| add | back to summary |
|---|---|
| public PolynomialGF2mSmallM add(PolynomialGF2mSmallM addend) Compute the sum of this polynomial and the given polynomial.
| |
| add | back to summary |
|---|---|
| private int[] add(int[] a, int[] b) Compute the sum of two polynomials a and b over the finite field GF(2^m).
| |
| addMonomial | back to summary |
|---|---|
| public PolynomialGF2mSmallM addMonomial(int degree) Compute the sum of this polynomial and the monomial of the given degree.
| |
| addToThis | back to summary |
|---|---|
| public void addToThis(PolynomialGF2mSmallM addend) Add the given polynomial to this polynomial (overwrite this).
| |
| computeDegree | back to summary |
|---|---|
| private void computeDegree() Compute the degree of this polynomial. If this is the zero polynomial, the degree is -1. | |
| computeDegree | back to summary |
|---|---|
| private static int computeDegree(int[] a) Compute the degree of a polynomial.
| |
| createRandomIrreduciblePolynomial | back to summary |
|---|---|
| private int[] createRandomIrreduciblePolynomial(int deg, SecureRandom sr) Create an irreducible polynomial with the given degree over the field GF(2^m).
| |
| div | back to summary |
|---|---|
| public PolynomialGF2mSmallM[] div(PolynomialGF2mSmallM f) Divide this polynomial by the given polynomial.
| |
| div | back to summary |
|---|---|
| private int[][] div(int[] a, int[] f) Compute the result of the division of two polynomials over the field GF(2^m).
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. checks if given object is equal to this polynomial. The method returns false whenever the given object is not polynomial over GF(2^m).
| |
| evaluateAt | back to summary |
|---|---|
| public int evaluateAt(int e) Evaluate this polynomial p at a value e (in GF(2^m)) with the Horner scheme.
| |
| gcd | back to summary |
|---|---|
| public PolynomialGF2mSmallM gcd(PolynomialGF2mSmallM f) Return the greatest common divisor of this and a polynomial f
| |
| gcd | back to summary |
|---|---|
| private int[] gcd(int[] f, int[] g) Return the greatest common divisor of two polynomials over the field GF(2^m).
| |
| getCoefficient | back to summary |
|---|---|
| public int getCoefficient(int index) Return the coefficient with the given index.
| |
| getDegree | back to summary |
|---|---|
| public int getDegree() Return the degree of this polynomial
| |
| getEncoded | back to summary |
|---|---|
| public byte[] getEncoded() Returns encoded polynomial, i.e., this polynomial in byte array form
| |
| getHeadCoefficient | back to summary |
|---|---|
public int getHeadCoefficient()
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| headCoefficient | back to summary |
|---|---|
| private static int headCoefficient(int[] a) Return the head coefficient of a polynomial.
| |
| isEqual | back to summary |
|---|---|
| private static boolean isEqual(int[] a, int[] b) Compare two polynomials given as int arrays.
| |
| isIrreducible | back to summary |
|---|---|
| private boolean isIrreducible(int[] a) Check a polynomial for irreducibility over the field GF(2^m).
| |
| mod | back to summary |
|---|---|
| public PolynomialGF2mSmallM mod(PolynomialGF2mSmallM f) Reduce this polynomial modulo another polynomial.
| |
| mod | back to summary |
|---|---|
| private int[] mod(int[] a, int[] f) Reduce a polynomial modulo another polynomial.
| |
| modDiv | back to summary |
|---|---|
| public PolynomialGF2mSmallM modDiv(PolynomialGF2mSmallM divisor, PolynomialGF2mSmallM modulus) Compute the result of the division of this polynomial by another polynomial modulo a third polynomial.
| |
| modDiv | back to summary |
|---|---|
| private int[] modDiv(int[] a, int[] b, int[] g) Compute the result of the division of two polynomials modulo a third polynomial over the field GF(2^m).
| |
| modInverse | back to summary |
|---|---|
| public PolynomialGF2mSmallM modInverse(PolynomialGF2mSmallM a) Compute the inverse of this polynomial modulo the given polynomial.
| |
| modMultiply | back to summary |
|---|---|
| public PolynomialGF2mSmallM modMultiply(PolynomialGF2mSmallM a, PolynomialGF2mSmallM b) Compute the product of this polynomial and another polynomial modulo a third polynomial.
| |
| modMultiply | back to summary |
|---|---|
| private int[] modMultiply(int[] a, int[] b, int[] g) Compute the product of two polynomials modulo a third polynomial over the finite field GF(2^m).
| |
| modPolynomialToFracton | back to summary |
|---|---|
| public 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.
| |
| modSquareMatrix | back to summary |
|---|---|
| public PolynomialGF2mSmallM modSquareMatrix(PolynomialGF2mSmallM[] matrix) Square this polynomial using a squaring matrix.
| |
| modSquareRoot | back to summary |
|---|---|
| public PolynomialGF2mSmallM modSquareRoot(PolynomialGF2mSmallM a) Compute the square root of this polynomial modulo the given polynomial.
| |
| modSquareRootMatrix | back to summary |
|---|---|
| public PolynomialGF2mSmallM modSquareRootMatrix(PolynomialGF2mSmallM[] matrix) Compute the square root of this polynomial using a square root matrix.
| |
| multiply | back to summary |
|---|---|
| public PolynomialGF2mSmallM multiply(PolynomialGF2mSmallM factor) Compute the product of this polynomial and the given factor using a Karatzuba like scheme.
| |
| multiply | back to summary |
|---|---|
| private int[] multiply(int[] a, int[] b) Compute the product of two polynomials over the field GF(2^m) using a Karatzuba like multiplication.
| |
| multThisWithElement | back to summary |
|---|---|
| public void multThisWithElement(int element) Multiply this polynomial with an element from GF(2^m).
| |
| multWithElement | back to summary |
|---|---|
| public PolynomialGF2mSmallM multWithElement(int element) Compute the product of this polynomial with an element from GF(2^m).
| |
| multWithElement | back to summary |
|---|---|
| private int[] multWithElement(int[] a, int element) Compute the product of a polynomial a with an element from the finite field GF(2^m).
| |
| multWithMonomial | back to summary |
|---|---|
| public PolynomialGF2mSmallM multWithMonomial(int k) Compute the product of this polynomial with a monomial X^k.
| |
| multWithMonomial | back to summary |
|---|---|
| private static int[] multWithMonomial(int[] a, int k) Compute the product of a polynomial with a monomial X^k.
| |
| normalForm | back to summary |
|---|---|
| private static int[] normalForm(int[] a) Strip leading zero coefficients from the given polynomial.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a human readable form of the polynomial.
| |