Crates.io | guff |
lib.rs | guff |
version | 0.1.7 |
source | src |
created_at | 2021-06-26 00:40:41.062298 |
updated_at | 2021-07-01 15:15:46.524165 |
description | Implements Galois Fields for various natural sizes |
homepage | https://github.com/declanmalone/guff |
repository | |
max_upload_size | |
id | 415036 |
size | 121,619 |
Implements GF(2x) for various "natural" sizes such as 28, 216 and 232.
My goals for this crate are to:
help me learn to write good modules in Rust;
help interested users learn about finite fields (ie, Galois fields);
provide a generic baseline implementation of basic maths (add, multiply, divide, etc.) over finite fields;
explore various optimisations/adaptations (including table-based lookups and architecture-specific SIMD code) that can selectively override some/all of the default implementations while remaining compatible with other implementations.
Also to:
provide some useful utility functions that go beyond just
add
, mul
, div
, etc. (eg, determining whether a field
polynomial is primitive, or generating lookup tables for different
kinds of optimisations);
eat my own dog food, so to speak, by implementing various applications that use the library;
benchmark particular implementations of interest.
Steps to using this library:
decide what "class" of field you want to use (GF(28), GF(216), etc.);
decide if you want to use one of the optimised adaptations or are happy with the default generic code;
create a new field object (we can call f
) of that class with
your chosen field polynomial (aka "irreducible polynomial") by
calling the appropriate constructor;
use that object to do maths in that field: eg, result = f.mul(a,b)
* The crate name is deliberately hyperbolic:
Noun guff - unacceptable behavior (especially ludicrously false statements)
This work is Copyright (c) Declan Malone, 2021.
You may freely copy and modify this work under the terms of:
If you wish to embed this work as part of another work, you may do so under the terms of:
Disclaimer: this software comes with no warranty, express or implied.