#ida #galois #learning #maths #speed


Implements Galois Fields for various natural sizes

8 releases

0.1.7 Jul 1, 2021
0.1.6 Jun 29, 2021

#954 in Math

Download history 18/week @ 2023-06-13 37/week @ 2023-06-20 40/week @ 2023-06-27 53/week @ 2023-07-04 32/week @ 2023-07-11 36/week @ 2023-07-18 19/week @ 2023-07-25 12/week @ 2023-08-01 16/week @ 2023-08-08 26/week @ 2023-08-15 13/week @ 2023-08-22 16/week @ 2023-08-29 35/week @ 2023-09-05 15/week @ 2023-09-12 10/week @ 2023-09-19 22/week @ 2023-09-26

86 downloads per month
Used in 4 crates

GPL-2.0-or-later OR LGPL-2.0-or-later

1.5K SLoC

Grand Unified Finite Field library*

Implements GF(2x) for various "natural" sizes such as 28, 216 and 232.

My goals for this crate are to:

  1. help me learn to write good modules in Rust;

  2. help interested users learn about finite fields (ie, Galois fields);

  3. provide a generic baseline implementation of basic maths (add, multiply, divide, etc.) over finite fields;

  4. 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:

  1. 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);

  2. eat my own dog food, so to speak, by implementing various applications that use the library;

  3. benchmark particular implementations of interest.

Basic Use: doing maths in a particular field

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)

Crate Name

* The crate name is deliberately hyperbolic:

Noun guff - unacceptable behavior (especially ludicrously false statements)

Copyright and Licence

This work is Copyright (c) Declan Malone, 2021.

You may freely copy and modify this work under the terms of:

  • The GNU General Public License version 2 or later

If you wish to embed this work as part of another work, you may do so under the terms of:

  • The GNU Lesser General Public License version 2 or later

Disclaimer: this software comes with no warranty, express or implied.