net.i2p.crypto.eddsa.math.bigint

## Class BigIntegerFieldElement

- java.lang.Object
- - net.i2p.crypto.eddsa.math.FieldElement
  - - net.i2p.crypto.eddsa.math.bigint.BigIntegerFieldElement

- All Implemented Interfaces:
    Serializable

      public class BigIntegerFieldElement
      extends FieldElement
      implements Serializable

  A particular element of the field \Z/(2^255-19).
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) BigInteger` | `bi` Variable is package private for encoding.

    - ### Fields inherited from class net.i2p.crypto.eddsa.math.FieldElement

      `f`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BigIntegerFieldElement(Field f, BigInteger bi)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FieldElement` | `add(FieldElement val)` Adds another field element to this one.
    `FieldElement` | `addOne()` Adds one to this field element.
    `FieldElement` | `cmov(FieldElement val, int b)` Conditional move - sets this element to val if b is 1, otherwise leaves it unchanged.
    `FieldElement` | `divide(BigInteger val)`
    `FieldElement` | `divide(FieldElement val)` Divides this field element by another one.
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `FieldElement` | `invert()` Computes the multiplicative inverse of this field element.
    `boolean` | `isNonZero()` Checks if this field element is non-zero.
    `FieldElement` | `mod(FieldElement m)`
    `FieldElement` | `modPow(FieldElement e, FieldElement m)`
    `FieldElement` | `multiply(FieldElement val)` Multiplies this field element by another one.
    `FieldElement` | `negate()` Negates this field element.
    `FieldElement` | `pow(FieldElement e)`
    `FieldElement` | `pow22523()` Raises this field element to the power of $2^{252} - 3$.
    `FieldElement` | `square()` Squares this field element.
    `FieldElement` | `squareAndDouble()` Squares this field element and doubles the result.
    `FieldElement` | `subtract(FieldElement val)` Subtracts another field element from this one.
    `FieldElement` | `subtractOne()` Subtracts one from this field element.
    `String` | `toString()`

    - ### Methods inherited from class net.i2p.crypto.eddsa.math.FieldElement

      `isNegative, toByteArray`

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

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

- - ### Field Detail

    - #### bi

          final BigInteger bi

      Variable is package private for encoding.

  - ### Constructor Detail

    - #### BigIntegerFieldElement

          public BigIntegerFieldElement(Field f,
                                        BigInteger bi)

  - ### Method Detail

    - #### add

          public FieldElement add(FieldElement val)

      Description copied from class: `FieldElement`
      Adds another field element to this one.
      Specified by:
        `add` in class `FieldElement`
      Parameters:
        `val` - the field element to add
      Returns:
        the sum of this element and val

    - #### addOne

          public FieldElement addOne()

      Description copied from class: `FieldElement`
      Adds one to this field element.
      Overrides:
        `addOne` in class `FieldElement`
      Returns:
        this element plus one

    - #### cmov

          public FieldElement cmov(FieldElement val,
                                   int b)

      Description copied from class: `FieldElement`
      Conditional move - sets this element to val if b is 1, otherwise leaves it unchanged.
      Specified by:
        `cmov` in class `FieldElement`
      Parameters:
        `val` - the field element to potentially assign
        `b` - the condition: 1 means assign val, 0 means keep this element
      Returns:
        this element, potentially modified

    - #### divide

          public FieldElement divide(BigInteger val)

    - #### divide

          public FieldElement divide(FieldElement val)

      Description copied from class: `FieldElement`
      Divides this field element by another one.
      Overrides:
        `divide` in class `FieldElement`
      Parameters:
        `val` - the divisor
      Returns:
        this element divided by val

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### invert

          public FieldElement invert()

      Description copied from class: `FieldElement`
      Computes the multiplicative inverse of this field element.
      Specified by:
        `invert` in class `FieldElement`
      Returns:
        the multiplicative inverse of this element

    - #### isNonZero

          public boolean isNonZero()

      Description copied from class: `FieldElement`
      Checks if this field element is non-zero.
      Specified by:
        `isNonZero` in class `FieldElement`
      Returns:
        true if this element is not equal to zero, false otherwise

    - #### mod

          public FieldElement mod(FieldElement m)

    - #### modPow

          public FieldElement modPow(FieldElement e,
                                     FieldElement m)

    - #### multiply

          public FieldElement multiply(FieldElement val)

      Description copied from class: `FieldElement`
      Multiplies this field element by another one.
      Specified by:
        `multiply` in class `FieldElement`
      Parameters:
        `val` - the multiplier
      Returns:
        the product of this element and val

    - #### negate

          public FieldElement negate()

      Description copied from class: `FieldElement`
      Negates this field element.
      Specified by:
        `negate` in class `FieldElement`
      Returns:
        the negation of this element

    - #### pow

          public FieldElement pow(FieldElement e)

    - #### pow22523

          public FieldElement pow22523()

      Description copied from class: `FieldElement`
      Raises this field element to the power of $2^{252} - 3$.
      Specified by:
        `pow22523` in class `FieldElement`
      Returns:
        this element raised to the power of $2^{252} - 3$

    - #### square

          public FieldElement square()

      Description copied from class: `FieldElement`
      Squares this field element.
      Specified by:
        `square` in class `FieldElement`
      Returns:
        this element squared

    - #### squareAndDouble

          public FieldElement squareAndDouble()

      Description copied from class: `FieldElement`
      Squares this field element and doubles the result.
      Specified by:
        `squareAndDouble` in class `FieldElement`
      Returns:
        (this element squared) * 2

    - #### subtract

          public FieldElement subtract(FieldElement val)

      Description copied from class: `FieldElement`
      Subtracts another field element from this one.
      Specified by:
        `subtract` in class `FieldElement`
      Parameters:
        `val` - the field element to subtract
      Returns:
        the difference of this element and val

    - #### subtractOne

          public FieldElement subtractOne()

      Description copied from class: `FieldElement`
      Subtracts one from this field element.
      Overrides:
        `subtractOne` in class `FieldElement`
      Returns:
        this element minus one

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`