Finite Field

Binary

class pyerasure.finite_field.Binary

The binary finite field class.

classmethod add(lhs: int, rhs: int) int

Add two elements.

classmethod bytes_to_elements(bytes: int) int

Convert the number of bytes to the number of elements.

classmethod divide(lhs: int, rhs: int) int

Divide two elements.

classmethod elements_to_bytes(elements: int) int

Convert the number of elements to the number of bytes.

classmethod get_value(elements: bytearray, index: int) int

Return the value of the element at the given index.

classmethod is_binary() bool

Check if the field is binary.

classmethod set_value(elements: bytearray, index: int, value: int)

Set the value of the element at the given index.

classmethod vector_add_into(x: bytearray, y: bytearray)

Add y into x.

classmethod vector_multiply_add_into(x: bytearray, y: bytes, c: int)

Multiply the vector y with the constant c and then add the result to vector x.

classmethod vector_multiply_subtract_into(x: bytearray, y: bytes, c: int)

Multiply the vector x with the vector y and subtract the result from c.

Binary4

class pyerasure.finite_field.Binary4(prime: int = 19)

The binary4 finite field class.

classmethod add(lhs: int, rhs: int) int

Add two elements.

classmethod bytes_to_elements(bytes: int) int

Convert the number of bytes to the number of elements.

classmethod elements_to_bytes(elements: int) int

Convert the number of elements to the number of bytes.

classmethod get_value(elements: bytearray, index: int) int

Return the value of the element at the given index.

invert(x: int) int

Invert the given element.

classmethod is_binary() bool

Check if the field is binary.

classmethod set_value(elements: bytearray, index: int, value: int)

Set the value of the element at the given index.

classmethod vector_add_into(x: bytearray, y: bytearray)

Add y into x.

vector_multiply_add_into(x: bytearray, y: bytes, c: int)

Multiply the vector y with the constant c and then add the result to vector x.

vector_multiply_into(x: bytearray, c: int)

Multiply the vector x with the vector y.

vector_multiply_subtract_into(x: bytearray, y: bytes, c: int)

Multiply the vector x with the vector y and subtract the result from c.

Binary8

class pyerasure.finite_field.Binary8(prime: int = 285)

The binary8 finite field class.

classmethod add(lhs: int, rhs: int) int

Add two elements.

classmethod bytes_to_elements(bytes: int) int

Convert the number of bytes to the number of elements.

classmethod elements_to_bytes(elements: int) int

Convert the number of elements to the number of bytes.

classmethod get_value(elements: bytearray, index: int) int

Return the value of the element at the given index.

invert(x: int) int

Invert the given element.

classmethod is_binary() bool

Check if the field is binary.

classmethod set_value(elements: bytearray, index: int, value: int)

Set the value of the element at the given index.

classmethod vector_add_into(x: bytearray, y: bytearray)

Add y into x.

vector_multiply_add_into(x: bytearray, y: bytes, c: int)

Multiply the vector y with the constant c and then add the result to vector x.

vector_multiply_into(x: bytearray, c: int)

Multiply the vector x with the vector y.

vector_multiply_subtract_into(x: bytearray, y: bytes, c: int)

Multiply the vector x with the vector y and subtract the result from c.

Fork me on GitHub
Versions
1.3.0
1.2.0
1.1.0
1.0.1
1.0.0
Development
latest