ECFieldElement.F2m (Bouncy Castle Library 1.52 API Specification)

org.bouncycastle.math.ec

## Class ECFieldElement.F2m

- java.lang.Object
- - org.bouncycastle.math.ec.ECFieldElement
  - - org.bouncycastle.math.ec.ECFieldElement.F2m

- All Implemented Interfaces:
    ECConstants
  Enclosing class:
    ECFieldElement

      public static class ECFieldElement.F2m
      extends ECFieldElement

  Class representing the Elements of the finite field `F2m` 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.F2m, ECFieldElement.Fp`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `GNB` Indicates gaussian normal basis representation (GNB).
    `static int` | `PPB` Indicates pentanomial basis representation (PPB).
    `static int` | `TPB` Indicates trinomial basis representation (TPB).

    - ### Fields inherited from interface org.bouncycastle.math.ec.ECConstants

      `FOUR, ONE, THREE, TWO, ZERO`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ECFieldElement.F2m(int m, int k, java.math.BigInteger x)` Deprecated. Use ECCurve.fromBigInteger to construct field elements
    `ECFieldElement.F2m(int m, int k1, int k2, int k3, java.math.BigInteger x)` Deprecated. Use ECCurve.fromBigInteger to construct field elements

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ECFieldElement` | `add(ECFieldElement b)`
    `ECFieldElement` | `addOne()`
    `int` | `bitLength()`
    `static void` | `checkFieldElements(ECFieldElement a, ECFieldElement b)` Checks, if the ECFieldElements `a` and `b` are elements of the same field `F2m` (having the same representation).
    `ECFieldElement` | `divide(ECFieldElement b)`
    `boolean` | `equals(java.lang.Object anObject)`
    `java.lang.String` | `getFieldName()`
    `int` | `getFieldSize()`
    `int` | `getK1()`
    `int` | `getK2()`
    `int` | `getK3()`
    `int` | `getM()`
    `int` | `getRepresentation()`
    `int` | `hashCode()`
    `ECFieldElement` | `invert()`
    `boolean` | `isOne()`
    `boolean` | `isZero()`
    `ECFieldElement` | `multiply(ECFieldElement b)`
    `ECFieldElement` | `multiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)`
    `ECFieldElement` | `multiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)`
    `ECFieldElement` | `negate()`
    `ECFieldElement` | `sqrt()`
    `ECFieldElement` | `square()`
    `ECFieldElement` | `squareMinusProduct(ECFieldElement x, ECFieldElement y)`
    `ECFieldElement` | `squarePlusProduct(ECFieldElement x, ECFieldElement y)`
    `ECFieldElement` | `subtract(ECFieldElement b)`
    `boolean` | `testBitZero()`
    `java.math.BigInteger` | `toBigInteger()`

    - ### Methods inherited from class org.bouncycastle.math.ec.ECFieldElement

      `getEncoded, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### 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

    - #### ECFieldElement.F2m

          public ECFieldElement.F2m(int m,
                            int k1,
                            int k2,
                            int k3,
                            java.math.BigInteger x)

      Deprecated. Use ECCurve.fromBigInteger to construct field elements
      Constructor for PPB.
      Parameters:
        `m` - The exponent `m` of `F2m`.
        `k1` - The integer `k1` where `xm + xk3 + xk2 + xk1 + 1` represents the reduction polynomial `f(z)`.
        `k2` - The integer `k2` where `xm + xk3 + xk2 + xk1 + 1` represents the reduction polynomial `f(z)`.
        `k3` - The integer `k3` where `xm + xk3 + xk2 + xk1 + 1` represents the reduction polynomial `f(z)`.
        `x` - The BigInteger representing the value of the field element.

    - #### ECFieldElement.F2m

          public ECFieldElement.F2m(int m,
                            int k,
                            java.math.BigInteger x)

      Deprecated. Use ECCurve.fromBigInteger to construct field elements
      Constructor for TPB.
      Parameters:
        `m` - The exponent `m` of `F2m`.
        `k` - The integer `k` where `xm + xk + 1` represents the reduction polynomial `f(z)`.
        `x` - The BigInteger representing the value of the field element.

  - ### Method Detail

    - #### bitLength

          public int bitLength()

      Overrides:
        `bitLength` in class `ECFieldElement`

    - #### isOne

          public boolean isOne()

      Overrides:
        `isOne` in class `ECFieldElement`

    - #### isZero

          public boolean isZero()

      Overrides:
        `isZero` in class `ECFieldElement`

    - #### testBitZero

          public boolean testBitZero()

      Overrides:
        `testBitZero` in class `ECFieldElement`

    - #### toBigInteger

          public java.math.BigInteger toBigInteger()

      Specified by:
        `toBigInteger` in class `ECFieldElement`

    - #### getFieldName

          public java.lang.String getFieldName()

      Specified by:
        `getFieldName` in class `ECFieldElement`

    - #### getFieldSize

          public int getFieldSize()

      Specified by:
        `getFieldSize` in class `ECFieldElement`

    - #### checkFieldElements

          public static void checkFieldElements(ECFieldElement a,
                                ECFieldElement b)

      Checks, if the ECFieldElements `a` and `b` are elements of the same field `F2m` (having the same representation).
      Parameters:
        `a` - field element.
        `b` - field element to be compared.
      Throws:
        `java.lang.IllegalArgumentException` - if `a` and `b` are not elements of the same field `F2m` (having the same representation).

    - #### add

          public ECFieldElement add(ECFieldElement b)

      Specified by:
        `add` in class `ECFieldElement`

    - #### addOne

          public ECFieldElement addOne()

      Specified by:
        `addOne` in class `ECFieldElement`

    - #### subtract

          public ECFieldElement subtract(ECFieldElement b)

      Specified by:
        `subtract` in class `ECFieldElement`

    - #### multiply

          public ECFieldElement multiply(ECFieldElement b)

      Specified by:
        `multiply` in class `ECFieldElement`

    - #### multiplyMinusProduct

          public ECFieldElement multiplyMinusProduct(ECFieldElement b,
                                            ECFieldElement x,
                                            ECFieldElement y)

      Overrides:
        `multiplyMinusProduct` in class `ECFieldElement`

    - #### multiplyPlusProduct

          public ECFieldElement multiplyPlusProduct(ECFieldElement b,
                                           ECFieldElement x,
                                           ECFieldElement y)

      Overrides:
        `multiplyPlusProduct` in class `ECFieldElement`

    - #### divide

          public ECFieldElement divide(ECFieldElement b)

      Specified by:
        `divide` in class `ECFieldElement`

    - #### negate

          public ECFieldElement negate()

      Specified by:
        `negate` in class `ECFieldElement`

    - #### square

          public ECFieldElement square()

      Specified by:
        `square` in class `ECFieldElement`

    - #### squareMinusProduct

          public ECFieldElement squareMinusProduct(ECFieldElement x,
                                          ECFieldElement y)

      Overrides:
        `squareMinusProduct` in class `ECFieldElement`

    - #### squarePlusProduct

          public ECFieldElement squarePlusProduct(ECFieldElement x,
                                         ECFieldElement y)

      Overrides:
        `squarePlusProduct` in class `ECFieldElement`

    - #### invert

          public ECFieldElement invert()

      Specified by:
        `invert` in class `ECFieldElement`

    - #### sqrt

          public ECFieldElement sqrt()

      Specified by:
        `sqrt` in class `ECFieldElement`

    - #### 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 `m` of the reduction polynomial `f(z)`.

    - #### getK1

          public int getK1()

      Returns:
        TPB: The integer `k` where `xm + xk + 1` represents the reduction polynomial `f(z)`.
        PPB: The integer `k1` where `xm + xk3 + xk2 + xk1 + 1` represents the reduction polynomial `f(z)`.

    - #### getK2

          public int getK2()

      Returns:
        TPB: Always returns `0`
        PPB: The integer `k2` where `xm + xk3 + xk2 + xk1 + 1` represents the reduction polynomial `f(z)`.

    - #### getK3

          public int getK3()

      Returns:
        TPB: Always set to `0`
        PPB: The integer `k3` where `xm + xk3 + xk2 + xk1 + 1` represents the reduction polynomial `f(z)`.

    - #### equals

          public boolean equals(java.lang.Object anObject)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`