tinyfield 0.1.2

Small, finite fields.
Documentation
  • Coverage
  • 10.26%
    8 out of 78 items documented1 out of 66 items with examples
  • Size
  • Source code size: 173.65 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 20.32 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • rspencer01/tinyfield
    1 1 3
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rspencer01

Finite Fields In no_std Rust

Build Status Latest Version Coverage Status

This crate exposes a number of small finite field types. It does not depend on the standard library.

At time of writing, the top few results for "rust finite fields" in a google search shows:

  • A crate that no longer compiles, and doesn't implement finite fields correctly at all
  • A crate that only implements fields of characteristic two
  • A crate that does general finite fields, but doesn't expose arithmetic past addition for higher degree finite fields.

This crate attempts to supply:

  • A small library with low footprint when linked
  • Support for as many fields as I have energy to write irreducible polynomials for
  • Small finite field elements (up to 32 bits only)
  • Small characteristic fields only (fitting in one u8)

This crate does not attempt to:

  • Be particularly fast
  • Handle large primes suitable for, say, cryptography

This crate should, in the future:

  • Handle all finite fields that fit within a u32
  • Never rely on std
  • Be a pleasure to use and have intuitive interfaces
  • Have easy to understand code without unnecessary optimisation

Pull requests to make that happen would be most welcome.

Issues on the github tracker are also welcome.

Example usage

# use tinyfield::prime_power_field::*;
type F = tinyfield::fields::GF9;

let delta = F::elts()
              .filter(|x| x * x - 2.into() == F::zero)
              .next()
              .expect("GF9 should contain a square root of two");