Crates.io | galois_field_2pm |
lib.rs | galois_field_2pm |
version | 0.1.0 |
source | src |
created_at | 2022-12-27 02:51:28.98756 |
updated_at | 2022-12-27 02:51:28.98756 |
description | Galois Field (2^M) arithmetic |
homepage | |
repository | https://github.com/KarolW6010/galois_field_2pm |
max_upload_size | |
id | 746041 |
size | 44,658 |
A Rust library for representing and performing arithmetic of elements of Galois Fields of size 2M.
This library suppoorts addition, subtraction, multiplication, division, and inversion of elements in GF(2M) for 2 ≤ M ≤ 127. Two implementations are supported. The implementations affect how multiplication, division, and inversion are computed. The first implementation uses look up tables while the second implementation uses the Extended Euclidean Algorithm.
GF(2M) is isomorphic to ${GF(2)[x] \over p(x)}$ where p(x) is an irreducible polynomial over GF(2) of degree M. Elements of GF(2M) can therfore be uniquely be mapped to polynomials over GF(2) with degree less than M. In order to represent all the polynomials over GF(2) with degree less than M, M bits are needed.
The look up table implementation can only be used when p(x) is a primitive polynomial with degree less than or equal to 16. The other implementation will work with any irreducible polynomial up to degree 127.