Package java.security.spec
Class ECFieldF2m
- java.lang.Object
-
- java.security.spec.ECFieldF2m
-
-
Constructor Summary
Constructors Constructor Description ECFieldF2m(int m)Creates a newECFieldF2mwith2^melements with a normal basis.ECFieldF2m(int m, int[] ks)Creates a newECFieldF2mwith2^melements with a polynomial basis and the reduction polynomial based onks.ECFieldF2m(int m, BigInteger rp)Creates a newECFieldF2mwith2^melements with a polynomial basis and the reduction polynomial based onrp.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Returns whether the specified object equals to this finite field.intgetFieldSize()Returns the size of this finite field (in bits).intgetM()Returns the exponentmfor this finite field, with2^mas the number of elements.int[]getMidTermsOfReductionPolynomial()Returns a copy of the integer array containing the order of the middle term(s) of the reduction polynomial for a polynomial basis.BigIntegergetReductionPolynomial()Returns the base of the reduction polynomial with the n-th bit corresponding to the n-th coefficient of the reduction polynomial for a polynomial basis.inthashCode()Returns the hashcode value for this finite field.
-
-
-
Constructor Detail
-
ECFieldF2m
public ECFieldF2m(int m)
Creates a newECFieldF2mwith2^melements with a normal basis.- Parameters:
m- the exponentmfor the number of elements.- Throws:
IllegalArgumentException- ifm <= zero.
-
ECFieldF2m
public ECFieldF2m(int m, BigInteger rp)Creates a newECFieldF2mwith2^melements with a polynomial basis and the reduction polynomial based onrp.The reduction polynomial must be either trinomial or pentanomial.
- Parameters:
m- the exponentmfor the number of elements.rp- the base of the reduction polynomial with the n-th bit corresponding to the n-th coefficient of the reduction polynomial.- Throws:
IllegalArgumentException- ifm <= zeroor therpis invalid.
-
ECFieldF2m
public ECFieldF2m(int m, int[] ks)Creates a newECFieldF2mwith2^melements with a polynomial basis and the reduction polynomial based onks.The reduction polynomial must be either trinomial or pentanomial.
- Parameters:
m- the exponentmfor the number of elements.ks- the base of the reduction polynomial with coefficients given in descending order.- Throws:
IllegalArgumentException- ifm <= zeroor the reduction polynomial is not valid.
-
-
Method Detail
-
equals
public boolean equals(Object obj)
Returns whether the specified object equals to this finite field.- Overrides:
equalsin classObject- Parameters:
obj- the object to compare to this finite field.- Returns:
trueif the specified object is equal to this finite field, otherwisefalse.- See Also:
Object.hashCode()
-
getFieldSize
public int getFieldSize()
Returns the size of this finite field (in bits).- Specified by:
getFieldSizein interfaceECField- Returns:
- the size of this finite field (in bits).
-
getM
public int getM()
Returns the exponentmfor this finite field, with2^mas the number of elements.- Returns:
- the exponent
mfor this finite field
-
getMidTermsOfReductionPolynomial
public int[] getMidTermsOfReductionPolynomial()
Returns a copy of the integer array containing the order of the middle term(s) of the reduction polynomial for a polynomial basis.- Returns:
- a copy of the integer array containing the order of the middle
term(s) of the reduction polynomial for a polynomial basis or
nullfor a normal basis.
-
getReductionPolynomial
public BigInteger getReductionPolynomial()
Returns the base of the reduction polynomial with the n-th bit corresponding to the n-th coefficient of the reduction polynomial for a polynomial basis.- Returns:
- the base of the reduction polynomial with the n-th bit
corresponding to the n-th coefficient of the reduction polynomial
for a polynomial basis or
nullfor a normal basis.
-
hashCode
public int hashCode()
Returns the hashcode value for this finite field.- Overrides:
hashCodein classObject- Returns:
- the hashcode value for this finite field.
- See Also:
Object.equals(java.lang.Object)
-
-