com.entrust.toolkit.security.crypto.ec insteadpublic class Polynomial extends java.lang.Object implements FieldElement
| Constructor and Description |
|---|
Polynomial(java.math.BigInteger value,
PolynomialField field)
Deprecated.
Creates an element in the
GF2mTrinomial field. |
Polynomial(Polynomial template)
Deprecated.
Creates an element that is the exact copy of the
template
argument. |
| Modifier and Type | Method and Description |
|---|---|
FieldElement |
add(FieldElement b)
Deprecated.
Adds th e argument,
b, to the calling element and returns
the result. |
void |
copy(Polynomial template)
Deprecated.
Copies the value of the
template argument into the calling
element. |
boolean |
equals(java.lang.Object obj)
Deprecated.
Compares two polynomials for equality.
|
FieldElement |
exponentiate(java.math.BigInteger b)
Deprecated.
Multiplies the calling by itself
b times and returns
the result. |
java.math.BigInteger |
getBigInteger()
Deprecated.
Returns the calling element as an integer.
|
int |
getDegree()
Deprecated.
Returns the degree of the calling polynomial.
|
Field |
getField()
Deprecated.
Returns the mathematical field to which the calling element belongs.
|
static boolean |
isIrreducible(java.math.BigInteger polynome)
Deprecated.
Returns
true if and only if polynome is
irreducible. |
FieldElement |
multiplicativeInverse()
Deprecated.
Returns the multiplicative inverse of the calling element.
|
FieldElement |
multiply(FieldElement b)
Deprecated.
Multiplies the argument,
b, by the calling element and
returns the result. |
void |
setAdd(Polynomial b)
Deprecated.
Adds the argument,
b, to the calling element. |
void |
setMultiplicativeInverse()
Deprecated.
Inverts the calling element.
|
void |
setMultiply(Polynomial b)
Deprecated.
Multiplies the argument,
b, by the calling element. |
FieldElement |
subtract(FieldElement b)
Deprecated.
Subtracts the argument,
b, from the calling element and
returns the result. |
ASN1Object |
toASN1Object()
Deprecated.
Returns an ASN.1 structure representing the calling element.
|
java.lang.String |
toString()
Deprecated.
Returns a
String representation of the calling polynomial. |
public Polynomial(java.math.BigInteger value,
PolynomialField field)
GF2mTrinomial field.value - the value of the element encoded as an integerfield - the field to which this element belongsjava.lang.IllegalArgumentException - if value is negativejava.lang.NullPointerException - if field is nullpublic Polynomial(Polynomial template)
template
argument.template - the element to be copiedjava.lang.NullPointerException - if template is nullpublic void copy(Polynomial template)
template argument into the calling
element.
template must belong to the same field as the calling
element.
template - the element to copyjava.lang.NullPointerException - if template is nullpublic Field getField()
getField in interface FieldElementField to which this element belongspublic FieldElement add(FieldElement b) throws java.lang.IllegalArgumentException
b, to the calling element and returns
the result.
The calling element remains unchanged.
add in interface FieldElementb - the value to add to this elementthis+bjava.lang.IllegalArgumentException - if b does not belong to the same field as
the calling elementpublic void setAdd(Polynomial b)
b, to the calling element.b - the value to add to the calling elementpublic FieldElement subtract(FieldElement b) throws java.lang.IllegalArgumentException
b, from the calling element and
returns the result.
The calling element remains unchanged.
subtract in interface FieldElementb - the value to substract from this elementthis-bjava.lang.IllegalArgumentException - if b does not belong to the same field as
the calling elementpublic FieldElement multiply(FieldElement b) throws java.lang.IllegalArgumentException
b, by the calling element and
returns the result.
This element remains unchanged.
multiply in interface FieldElementb - the value to multiply to this elementthis*bjava.lang.IllegalArgumentException - if b does not belong to the same field as
teh calling elementpublic void setMultiply(Polynomial b)
b, by the calling element.b - the value to multiply by the calling elementpublic FieldElement multiplicativeInverse()
For every element e, there is one multiplicative inverse
i, such that e*i = o, where o is the
one element of the field to which e and i belong.
multiplicativeInverse in interface FieldElementpublic void setMultiplicativeInverse()
public FieldElement exponentiate(java.math.BigInteger b) throws java.lang.IllegalArgumentException
b times and returns
the result.
The calling element remains unchanged.
exponentiate in interface FieldElementb - the exponentthis^bjava.lang.IllegalArgumentException - if b is negativepublic int getDegree()
The number of bits used to represent a polynomial is degree+1.
public boolean equals(java.lang.Object obj)
The equals method implements an equivalence relation:
x,
x.equals(x) should return true.x and
y, x.equals(y) should return
true if and only if y.equals(x) returns
true.x,
y, and z, if x.equals(y)
returns true and y.equals(z) returns
true, then x.equals(z) should return
true.x and
y, multiple invocations of x.equals(y)
consistently return true or consistently return
false.
x, x.equals(null)
should return false.
Two polynomials are equal if their fields and their integer representations are equal.
equals in interface FieldElementequals in class java.lang.Objectobj - the reference polynomial with which to comparetrue if the calling polynomial is the same as the
obj argument false otherwisepublic java.math.BigInteger getBigInteger()
The element is converted according to X9.62.
getBigInteger in interface FieldElementpublic java.lang.String toString()
String representation of the calling polynomial.toString in interface FieldElementtoString in class java.lang.ObjectStringpublic ASN1Object toASN1Object()
The ASN.1 structure is built according to the definition in X9.62.
toASN1Object in interface FieldElementpublic static boolean isIrreducible(java.math.BigInteger polynome)
true if and only if polynome is
irreducible.polynome - the integer representation of the polynomial to be tested for
irreducibilitytrue if the polynome is irreducible
false otherwise