Module prio::field

source ·
Expand description

Finite field arithmetic.

Basic field arithmetic is captured in the FieldElement trait. Fields used in Prio implement FftFriendlyFieldElement, and have an associated element called the “generator” that generates a multiplicative subgroup of order 2^n for some n.

Structs§

Enums§

  • Possible errors from finite field operations.

Traits§

  • Objects with this trait represent an element of GF(p), where p is some prime and the field’s multiplicative group has a subgroup with an order that is a power of 2, and at least 2^20.
  • Objects with this trait represent an element of GF(p) for some prime p.
  • Extension trait for field elements that can be converted back and forth to an integer type.
  • An integer type that accompanies a finite field. Integers and field elements may be converted back and forth via the natural map between residue classes modulo ‘p’ and integers between 0 and p - 1.

Functions§

  • Generate a vector of uniformly distributed random field elements.