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 field F 2 m in 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
-
-
Method Summary
-
Methods inherited from class org.bouncycastle.math.ec.ECFieldElement.AbstractF2m
halfTrace, hasFastTrace, trace
-
Methods inherited from class org.bouncycastle.math.ec.ECFieldElement
encodeTo, getEncoded, getEncodedLength, 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
-
-
Method Detail
-
bitLength
public int bitLength()
- Overrides:
bitLength
in classECFieldElement
-
isOne
public boolean isOne()
- Overrides:
isOne
in classECFieldElement
-
isZero
public boolean isZero()
- Overrides:
isZero
in classECFieldElement
-
testBitZero
public boolean testBitZero()
- Overrides:
testBitZero
in classECFieldElement
-
toBigInteger
public java.math.BigInteger toBigInteger()
- Specified by:
toBigInteger
in classECFieldElement
-
getFieldName
public java.lang.String getFieldName()
- Specified by:
getFieldName
in classECFieldElement
-
getFieldSize
public int getFieldSize()
- Specified by:
getFieldSize
in classECFieldElement
-
add
public ECFieldElement add(ECFieldElement b)
- Specified by:
add
in classECFieldElement
-
addOne
public ECFieldElement addOne()
- Specified by:
addOne
in classECFieldElement
-
subtract
public ECFieldElement subtract(ECFieldElement b)
- Specified by:
subtract
in classECFieldElement
-
multiply
public ECFieldElement multiply(ECFieldElement b)
- Specified by:
multiply
in classECFieldElement
-
multiplyMinusProduct
public ECFieldElement multiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
- Overrides:
multiplyMinusProduct
in classECFieldElement
-
multiplyPlusProduct
public ECFieldElement multiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
- Overrides:
multiplyPlusProduct
in classECFieldElement
-
divide
public ECFieldElement divide(ECFieldElement b)
- Specified by:
divide
in classECFieldElement
-
negate
public ECFieldElement negate()
- Specified by:
negate
in classECFieldElement
-
square
public ECFieldElement square()
- Specified by:
square
in classECFieldElement
-
squareMinusProduct
public ECFieldElement squareMinusProduct(ECFieldElement x, ECFieldElement y)
- Overrides:
squareMinusProduct
in classECFieldElement
-
squarePlusProduct
public ECFieldElement squarePlusProduct(ECFieldElement x, ECFieldElement y)
- Overrides:
squarePlusProduct
in classECFieldElement
-
squarePow
public ECFieldElement squarePow(int pow)
- Overrides:
squarePow
in classECFieldElement
-
invert
public ECFieldElement invert()
- Specified by:
invert
in classECFieldElement
-
sqrt
public ECFieldElement sqrt()
- Specified by:
sqrt
in classECFieldElement
-
getRepresentation
public int getRepresentation()
- Returns:
- the representation of the field F 2 m, either of TPB (trinomial basis representation) or PPB (pentanomial basis representation).
-
getM
public int getM()
- Returns:
- the degree m of the reduction polynomial f(z).
-
getK1
public int getK1()
- Returns:
- TPB: The integer k where x m + x k + 1 represents the reduction polynomial f(z). PPB: The integer k1 where x m + x k3 + x k2 + x k1 + 1 represents the reduction polynomial f(z).
-
getK2
public int getK2()
- Returns:
- TPB: Always returns 0 PPB: The integer k2 where x m + x k3 + x k2 + x k1 + 1 represents the reduction polynomial f(z).
-
getK3
public int getK3()
- Returns:
- TPB: Always set to 0 PPB: The integer k3 where x m + x k3 + x k2 + x k1 + 1 represents the reduction polynomial f(z).
-
equals
public boolean equals(java.lang.Object anObject)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-