class PrimeField extends FiniteField (View source)

Prime Finite Fields

Properties

protected int $instanceID Keeps track of current instance

Methods

__construct(BigInteger $modulo)

Default constructor

setReduction(callable $func)

Use a custom defined modular reduction function

object
newInteger(BigInteger $num)

Returns an instance of a dynamically generated PrimeFieldInteger class

object
randomInteger()

Returns an integer on the finite field between one and the prime modulo

int
getLengthInBytes()

Returns the length of the modulo in bytes

int
getLength()

Returns the length of the modulo in bits

Details

__construct(BigInteger $modulo)

Default constructor

Parameters

BigInteger $modulo

setReduction(callable $func)

Use a custom defined modular reduction function

Parameters

callable $func

object newInteger(BigInteger $num)

Returns an instance of a dynamically generated PrimeFieldInteger class

Parameters

BigInteger $num

Return Value

object

object randomInteger()

Returns an integer on the finite field between one and the prime modulo

Return Value

object

int getLengthInBytes()

Returns the length of the modulo in bytes

Return Value

int

int getLength()

Returns the length of the modulo in bits

Return Value

int