| Crates.io | gf2poly |
| lib.rs | gf2poly |
| version | 0.1.0 |
| created_at | 2025-03-31 22:17:01.072023+00 |
| updated_at | 2025-03-31 22:17:01.072023+00 |
| description | GF(2) polynomial arithmetic |
| homepage | |
| repository | https://github.com/8051enthusiast/gf2poly |
| max_upload_size | |
| id | 1614137 |
| size | 109,743 |
This rust crate provides a Gf2Poly type which implements polynomial arithmetic over GF(2).
It links against the gf2x C library and care is taken to be asymptotically efficient.
For example, multiplication is n log n (because the gf2x implementation is), and as a result, division can also be implemented in n log n.
This crate also implements a fast gcd in n log² n time and a basic implementation of factorization.
This crate requires the gf2x library to be installed.
It can either be installed through a package manager if you're lucky (but note that this is going to be a slow version because distro maintainers are generally conservative in what CPU features they enable), or it can be compiled using a release from INRIA's gitlab.
gf2poly provides two environment variables for controlling the linking:
GF2POLY_STATIC_LIB: If this is 1, gf2x will be linked statically.GF2POLY_LIBRARY_PATH: An additional path for the linker to search for static libraries at compile time.The source files in this repository are licensed under MIT, but note that the gf2x library this crate links against is licensed either under the GPLv3 or the LGPLv2.1+, depending on the version you use.