#finite #computation #fields #type #syntax #explicit #non-stdlib

nightly finite-fields

Traits and types for computations on finite fields

31 releases (9 breaking)

Uses old Rust 2015

0.10.3 Mar 29, 2017
0.9.5 Mar 13, 2017

#1993 in Rust patterns

Download history 12/week @ 2024-03-10 171/week @ 2024-03-31 1/week @ 2024-04-07

51 downloads per month
Used in turbo

MPL-2.0 and GPL-2.0 licenses

115KB
3K SLoC

finite-fields

cargo version badge

A crate providing explicit syntax for non-stdlib finite field types.

details

design goals

There are two parts to the crate's design:

  • Semantics: The types should facilitate direct expression of numeric types ranging over finite fields, so that the ideas expressed in the code are clear on their face.

  • Syntax: Syntax for working with the types should be transparent and universal where reasonable. For example, Add for GF(2) should present the same interface as Add for GF(4).

implementation

The implementations are not great, but they should work as a demonstration. The crate currently uses fixed-length arrays, with the idea that types be created by the programmer using macros. In other words, it stores the factored elements (the 'digits') of a number in the field as elements of a finite-length array.

roadmap

  • Binary types
  • Binary macros
  • Big refactor about here
  • Non-binary types
  • Non-binary macros
  • Rigorous tests
  • Refactor down huge macros
  • Tiny pieces

weird readings

Dependencies

~78KB