Module fp_wrapper

Module fp_wrapper 

Source
Expand description

This module provides convenience wrappers around the contents of crate::vector::inner in the special case where the field is a prime field. The main purpose is to put FqVector for different fields Fp<P> into a single enum, and to simplify scalars to just u32s instead of rather unwieldy FieldElement<Fp<P>>s. It does the same for the various slice structs.

The main magic occurs in the macros, such as dispatch_vector_inner, which we use to provide wrapper functions around the FqVector functions. To maintain consistency, we define the API in this file irrespective of whether the odd-primes feature is enabled or not, and it is the macros that will take care of making the distinction.

Note: Since we still want to have scalars simply be u32s, even when odd-primes is disabled, we can’t simply define type FpVector = FqVector<Fp<2>> like we previously did: we need to use a transparent wrapper.

Modules§

helpers 🔒
This module defines methods that assist in plumbing together methods that operate on u32s, such as the ones on FpVector, with methods that operate on FieldElement<Fp<P>>s, such as the ones on FqVector.
macros_generic 🔒

Enums§

FpSlice
FpSliceMut
FpVector
FpVectorIterator
FpVectorNonZeroIterator