Class: PField

verificatum.arithm.PField()

new PField()

Prime order field.
Source:

Extends

Methods

equals(other)

Compares this ring and the input ring.
Parameters:
Name Type Description
other Other instance of subclass of this class.
Overrides:
Source:
Returns:
true or false depending on if this ring equals the other. This is based on deep comparison of content.

getByteLength()

Fixed number of bytes needed to represent a ring element.
Overrides:
Source:
Returns:
Fixed number of bytes used to represent ring elements.

getEncodeLength()

Fixed number of bytes that can be encoded into a ring element.
Overrides:
Source:
Returns:
Fixed number of bytes that can be encoded into a ring element.

getONE()

Unit element of this ring.
Overrides:
Source:
Returns:
Unit element of this ring.

getPField()

Returns the underlying prime order field.
Overrides:
Source:
Returns:
Underlying prime order field.

getZERO()

Zero of the this ring.
Overrides:
Source:
Returns:
Zero of this ring.

randomElement(randomSource, statDist)

Generates a random element in the ring.
Parameters:
Name Type Description
randomSource Source of randomness.
statDist Statistical distance from the uniform distribution assuming a perfect random source.
Overrides:
Source:
Returns:
Randomly chosen element from the ring.

randomElementByteLength(statDist)

Number of random bytes needed to derive a random element with the given statistical distance to uniform.
Parameters:
Name Type Description
statDist Statistical distance from the uniform distribution assuming a perfect random source.
Overrides:
Source:
Returns:
Number of random bytes needed to derive a random element.

toElement(param)

Recovers an element from the input byte tree, or directly from a raw byte array.
Parameters:
Name Type Description
param Byte tree representation of an element, or a raw byte array.
Overrides:
Source:
Returns:
Element represented by the input.

toString()

Compiles a human readable representation of this field.
Overrides:
Source:
Returns:
Human readable representation of this field.