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§
- This iterator returns a sequence of field elements that are equal to zero or one, representing some integer in two’s complement form. See
FieldElementWithInteger::encode_as_bitvector
. GF(18446744069414584321)
, a 64-bit field.GF(340282366920938462946865773367900766209)
, a 128-bit field.GF(2^255 - 19)
, a 255-bit field.- Same as Field32, but encoded in little endian for compatibility with Prio v2.
Enums§
- Possible errors from finite field operations.
Traits§
- Objects with this trait represent an element of
GF(p)
, wherep
is some prime and the field’s multiplicative group has a subgroup with an order that is a power of 2, and at least2^20
. - Objects with this trait represent an element of
GF(p)
for some primep
. - 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.