# Class FieldElement

java.lang.Object
org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.FieldElement

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `Ed25519FieldElement`

public abstract class FieldElement extends Object implements Serializable
Note: concrete subclasses must implement hashCode() and equals()

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final Field`
`f`

## Constructor Summary

Constructors
Constructor
Description
`FieldElement(Field f)`

## Method Summary

Modifier and Type
Method
Description
`abstract FieldElement`
`add(FieldElement val)`
`FieldElement`
`addOne()`
`abstract FieldElement`
`cmov(FieldElement val, int b)`
`FieldElement`
`divide(FieldElement val)`
`abstract FieldElement`
`invert()`
`boolean`
`isNegative()`
`abstract boolean`
`isNonZero()`
`abstract FieldElement`
`multiply(FieldElement val)`
`abstract FieldElement`
`negate()`
`abstract FieldElement`
`pow22523()`
`abstract FieldElement`
`square()`
`abstract FieldElement`
`squareAndDouble()`
`abstract FieldElement`
`subtract(FieldElement val)`
`FieldElement`
`subtractOne()`
`byte[]`
`toByteArray()`
Encode a FieldElement in its $(b-1)$-bit encoding.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### f

protected final Field f

## Constructor Details

### FieldElement

public FieldElement(Field f)

## Method Details

### toByteArray

public byte[] toByteArray()
Encode a FieldElement in its $(b-1)$-bit encoding.

Returns:
  the $(b-1)$-bit encoding of this FieldElement.

### isNonZero

public abstract boolean isNonZero()

### isNegative

public boolean isNegative()

### add

public abstract FieldElement add(FieldElement val)

### addOne

public FieldElement addOne()

### subtract

public abstract FieldElement subtract(FieldElement val)

### subtractOne

public FieldElement subtractOne()

### negate

public abstract FieldElement negate()

### divide

public FieldElement divide(FieldElement val)

### multiply

public abstract FieldElement multiply(FieldElement val)

### square

public abstract FieldElement square()

### squareAndDouble

public abstract FieldElement squareAndDouble()

### invert

public abstract FieldElement invert()

### pow22523

public abstract FieldElement pow22523()

### cmov

public abstract FieldElement cmov(FieldElement val, int b)