PrimeField
extends FiniteField
in package
Prime Finite Fields
Tags
Table of Contents
Properties
- $instanceID : int
- Keeps track of current instance
- $instanceCounter : int
- Instance Counter
Methods
- __construct() : mixed
- Default constructor
- getLength() : int
- Returns the length of the modulo in bits
- getLengthInBytes() : int
- Returns the length of the modulo in bytes
- newInteger() : object
- Returns an instance of a dynamically generated PrimeFieldInteger class
- randomInteger() : object
- Returns an integer on the finite field between one and the prime modulo
- setReduction() : mixed
- Use a custom defined modular reduction function
Properties
$instanceID
Keeps track of current instance
protected
int
$instanceID
$instanceCounter
Instance Counter
private
static int
$instanceCounter
= 0
Methods
__construct()
Default constructor
public
__construct(BigInteger $modulo) : mixed
Parameters
- $modulo : BigInteger
getLength()
Returns the length of the modulo in bits
public
getLength() : int
Return values
intgetLengthInBytes()
Returns the length of the modulo in bytes
public
getLengthInBytes() : int
Return values
intnewInteger()
Returns an instance of a dynamically generated PrimeFieldInteger class
public
newInteger(BigInteger $num) : object
Parameters
- $num : BigInteger
Return values
objectrandomInteger()
Returns an integer on the finite field between one and the prime modulo
public
randomInteger() : object
Return values
objectsetReduction()
Use a custom defined modular reduction function
public
setReduction(callable $func) : mixed
Parameters
- $func : callable