Top Description Methods
org.bouncycastle.pqc.legacy.math.linearalgebra

public Interface GFElement

Known Direct Implementers
org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement
Imports
java.math.BigInteger

This interface defines a finite field element. It is implemented by the class GF2nElement.
See Also
GF2nElement

Method Summary

Modifier and TypeMethod and Description
public GFElement

Returns:

this + other (newly created)
add
(GFElement
the addend
addend
)

Compute the sum of this element and the addend.

public void
addToThis(GFElement
the addend
addend
)

Compute the sum of this element and the addend, overwriting this element.

public Object

Returns:

a copy of this GFElement
clone
()

public boolean

Returns:

the result of the comparison
equals
(Object
the other object
other
)

Compare this curve with another object.

public int

Returns:

the hash code of this element
hashCode
()

public GFElement

Returns:

this-1 (newly created)
invert
()

Compute the multiplicative inverse of this element.

public boolean

Returns:

true if this is the one element
isOne
()

Checks whether this element is one.

public boolean

Returns:

true if this is the zero element
isZero
()

Checks whether this element is zero.

public GFElement

Returns:

this * factor (newly created)
multiply
(GFElement
the factor
factor
)

Compute the product of this element and factor.

public void
multiplyThisBy(GFElement
the factor
factor
)

Compute this * factor (overwrite this).

public GFElement

Returns:

this - minuend (newly created)
subtract
(GFElement
the minuend
minuend
)

Compute the difference of this element and minuend.

public void
subtractFromThis(GFElement
the minuend
minuend
)

Compute the difference of this element and minuend, overwriting this element.

public byte[]

Returns:

this element as byte array
toByteArray
()

Returns this element as byte array.

public BigInteger

Returns:

this element as BigInt
toFlexiBigInt
()

Returns this element as FlexiBigInt.

public String

Returns:

String representation of this element
toString
()

Return a String representation of this element.

public String

Returns:

String representation of this element with the specified radix
toString
(int
specifies the radix of the String representation
radix
)

Return a String representation of this element.

Method Detail

addback to summary
public GFElement add(GFElement addend) throws RuntimeException

Compute the sum of this element and the addend.

Parameters
addend:GFElement

the addend

Returns:GFElement

this + other (newly created)

addToThisback to summary
public void addToThis(GFElement addend) throws RuntimeException

Compute the sum of this element and the addend, overwriting this element.

Parameters
addend:GFElement

the addend

cloneback to summary
public Object clone()
Returns:Object

a copy of this GFElement

equalsback to summary
public boolean equals(Object other)

Compare this curve with another object.

Parameters
other:Object

the other object

Returns:boolean

the result of the comparison

hashCodeback to summary
public int hashCode()
Returns:int

the hash code of this element

invertback to summary
public GFElement invert() throws ArithmeticException

Compute the multiplicative inverse of this element.

Returns:GFElement

this-1 (newly created)

Exceptions
ArithmeticException:
if this is the zero element.
isOneback to summary
public boolean isOne()

Checks whether this element is one.

Returns:boolean

true if this is the one element

isZeroback to summary
public boolean isZero()

Checks whether this element is zero.

Returns:boolean

true if this is the zero element

multiplyback to summary
public GFElement multiply(GFElement factor) throws RuntimeException

Compute the product of this element and factor.

Parameters
factor:GFElement

the factor

Returns:GFElement

this * factor (newly created)

multiplyThisByback to summary
public void multiplyThisBy(GFElement factor) throws RuntimeException

Compute this * factor (overwrite this).

Parameters
factor:GFElement

the factor

subtractback to summary
public GFElement subtract(GFElement minuend) throws RuntimeException

Compute the difference of this element and minuend.

Parameters
minuend:GFElement

the minuend

Returns:GFElement

this - minuend (newly created)

subtractFromThisback to summary
public void subtractFromThis(GFElement minuend)

Compute the difference of this element and minuend, overwriting this element.

Parameters
minuend:GFElement

the minuend

toByteArrayback to summary
public byte[] toByteArray()

Returns this element as byte array. The conversion is P1363-conform.

Returns:byte[]

this element as byte array

toFlexiBigIntback to summary
public BigInteger toFlexiBigInt()

Returns this element as FlexiBigInt. The conversion is P1363-conform.

Returns:BigInteger

this element as BigInt

toStringback to summary
public String toString()

Return a String representation of this element.

Returns:String

String representation of this element

toStringback to summary
public String toString(int radix)

Return a String representation of this element. radix specifies the radix of the String representation.

Parameters
radix:int

specifies the radix of the String representation

Returns:String

String representation of this element with the specified radix