Package org.bouncycastle.math.ec
Class ECFieldElement.F2m
- java.lang.Object
 - 
- org.bouncycastle.math.ec.ECFieldElement
 - 
- org.bouncycastle.math.ec.ECFieldElement.AbstractF2m
 - 
- org.bouncycastle.math.ec.ECFieldElement.F2m
 
 
 
 
- 
- All Implemented Interfaces:
 ECConstants
- Enclosing class:
 - ECFieldElement
 
public static class ECFieldElement.F2m extends ECFieldElement.AbstractF2m
Class representing the Elements of the finite fieldF2min polynomial basis (PB) representation. Both trinomial (TPB) and pentanomial (PPB) polynomial basis representations are supported. Gaussian normal basis (GNB) representation is not supported. 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class org.bouncycastle.math.ec.ECFieldElement
ECFieldElement.AbstractF2m, ECFieldElement.AbstractFp, ECFieldElement.F2m, ECFieldElement.Fp 
 - 
 
- 
Constructor Summary
Constructors Constructor Description F2m(int m, int k1, int k2, int k3, java.math.BigInteger x)Deprecated.Use ECCurve.fromBigInteger to construct field elements 
- 
Method Summary
- 
Methods inherited from class org.bouncycastle.math.ec.ECFieldElement.AbstractF2m
halfTrace, hasFastTrace, trace 
- 
Methods inherited from class org.bouncycastle.math.ec.ECFieldElement
getEncoded, toString 
 - 
 
 - 
 
- 
- 
Field Detail
- 
GNB
public static final int GNB
Indicates gaussian normal basis representation (GNB). Number chosen according to X9.62. GNB is not implemented at present.- See Also:
 - Constant Field Values
 
 
- 
TPB
public static final int TPB
Indicates trinomial basis representation (TPB). Number chosen according to X9.62.- See Also:
 - Constant Field Values
 
 
- 
PPB
public static final int PPB
Indicates pentanomial basis representation (PPB). Number chosen according to X9.62.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
F2m
public F2m(int m, int k1, int k2, int k3, java.math.BigInteger x)Deprecated.Use ECCurve.fromBigInteger to construct field elementsConstructor for PPB.- Parameters:
 m- The exponentmofF2m.k1- The integerk1wherexm + xk3 + xk2 + xk1 + 1represents the reduction polynomialf(z).k2- The integerk2wherexm + xk3 + xk2 + xk1 + 1represents the reduction polynomialf(z).k3- The integerk3wherexm + xk3 + xk2 + xk1 + 1represents the reduction polynomialf(z).x- The BigInteger representing the value of the field element.
 
 - 
 
- 
Method Detail
- 
bitLength
public int bitLength()
- Overrides:
 bitLengthin classECFieldElement
 
- 
isOne
public boolean isOne()
- Overrides:
 isOnein classECFieldElement
 
- 
isZero
public boolean isZero()
- Overrides:
 isZeroin classECFieldElement
 
- 
testBitZero
public boolean testBitZero()
- Overrides:
 testBitZeroin classECFieldElement
 
- 
toBigInteger
public java.math.BigInteger toBigInteger()
- Specified by:
 toBigIntegerin classECFieldElement
 
- 
getFieldName
public java.lang.String getFieldName()
- Specified by:
 getFieldNamein classECFieldElement
 
- 
getFieldSize
public int getFieldSize()
- Specified by:
 getFieldSizein classECFieldElement
 
- 
add
public ECFieldElement add(ECFieldElement b)
- Specified by:
 addin classECFieldElement
 
- 
addOne
public ECFieldElement addOne()
- Specified by:
 addOnein classECFieldElement
 
- 
subtract
public ECFieldElement subtract(ECFieldElement b)
- Specified by:
 subtractin classECFieldElement
 
- 
multiply
public ECFieldElement multiply(ECFieldElement b)
- Specified by:
 multiplyin classECFieldElement
 
- 
multiplyMinusProduct
public ECFieldElement multiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
- Overrides:
 multiplyMinusProductin classECFieldElement
 
- 
multiplyPlusProduct
public ECFieldElement multiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
- Overrides:
 multiplyPlusProductin classECFieldElement
 
- 
divide
public ECFieldElement divide(ECFieldElement b)
- Specified by:
 dividein classECFieldElement
 
- 
negate
public ECFieldElement negate()
- Specified by:
 negatein classECFieldElement
 
- 
square
public ECFieldElement square()
- Specified by:
 squarein classECFieldElement
 
- 
squareMinusProduct
public ECFieldElement squareMinusProduct(ECFieldElement x, ECFieldElement y)
- Overrides:
 squareMinusProductin classECFieldElement
 
- 
squarePlusProduct
public ECFieldElement squarePlusProduct(ECFieldElement x, ECFieldElement y)
- Overrides:
 squarePlusProductin classECFieldElement
 
- 
squarePow
public ECFieldElement squarePow(int pow)
- Overrides:
 squarePowin classECFieldElement
 
- 
invert
public ECFieldElement invert()
- Specified by:
 invertin classECFieldElement
 
- 
sqrt
public ECFieldElement sqrt()
- Specified by:
 sqrtin classECFieldElement
 
- 
getRepresentation
public int getRepresentation()
- Returns:
 - the representation of the field
 
F2m, either of TPB (trinomial basis representation) or PPB (pentanomial basis representation). 
 
- 
getM
public int getM()
- Returns:
 - the degree 
mof the reduction polynomialf(z). 
 
- 
getK1
public int getK1()
- Returns:
 - TPB: The integer 
kwherexm + xk + 1represents the reduction polynomialf(z).
PPB: The integerk1wherexm + xk3 + xk2 + xk1 + 1represents the reduction polynomialf(z). 
 
- 
getK2
public int getK2()
- Returns:
 - TPB: Always returns 
0
PPB: The integerk2wherexm + xk3 + xk2 + xk1 + 1represents the reduction polynomialf(z). 
 
- 
getK3
public int getK3()
- Returns:
 - TPB: Always set to 
0
PPB: The integerk3wherexm + xk3 + xk2 + xk1 + 1represents the reduction polynomialf(z). 
 
- 
equals
public boolean equals(java.lang.Object anObject)
- Overrides:
 equalsin classjava.lang.Object
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
 - 
 
 -