class BinaryField extends FiniteField (View source)

Binary Finite Fields

Properties

protected int $instanceID Keeps track of current instance

Methods

__construct(...$indices)

Default constructor

object
newInteger(string $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

static string
base2ToBase256(string $x, int $size = null)

Converts a base-2 string to a base-256 string

static string
base256ToBase2(string $x)

Converts a base-256 string to a base-2 string

Details

__construct(...$indices)

Default constructor

Parameters

...$indices

object newInteger(string $num)

Returns an instance of a dynamically generated PrimeFieldInteger class

Parameters

string $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

static string base2ToBase256(string $x, int $size = null)

Converts a base-2 string to a base-256 string

Parameters

string $x
int $size

Return Value

string

static string base256ToBase2(string $x)

Converts a base-256 string to a base-2 string

Parameters

string $x

Return Value

string