Module fp

Module fp 

Source
Expand description

This module contains the implementation of a prime field element Fp, altogether with exact implementations Fp64 for 64-bit, Fp128 for 128-bit elements and so on.

Finite field element Fp wraps a biginteger element in motgomery form, which is used for efficient multiplication and division.

Note that implementation of Ord for Fp compares field elements viewing them as integers in the range 0, 1, ..., P::MODULUS - 1. However, other implementations of PrimeField might choose a different ordering, and as such, users should use this Ord for applications where any ordering suffices (like in a BTreeMap), and not in applications where a particular ordering is required.

Structs§

Fp
Represents an element of the prime field F_p, where p == P::MODULUS.

Constants§

LIMBS_64
Number of limbs in the field with 64 bits size element.
LIMBS_128
Number of limbs in the field with 128 bits size element.
LIMBS_192
Number of limbs in the field with 192 bits size element.
LIMBS_256
Number of limbs in the field with 256 bits size element.
LIMBS_320
Number of limbs in the field with 320 bits size element.
LIMBS_384
Number of limbs in the field with 384 bits size element.
LIMBS_448
Number of limbs in the field with 448 bits size element.
LIMBS_512
Number of limbs in the field with 512 bits size element.
LIMBS_576
Number of limbs in the field with 576 bits size element.
LIMBS_640
Number of limbs in the field with 640 bits size element.
LIMBS_704
Number of limbs in the field with 704 bits size element.
LIMBS_768
Number of limbs in the field with 768 bits size element.
LIMBS_832
Number of limbs in the field with 832 bits size element.

Traits§

FpParams
A trait that specifies the configuration of a prime field. Also specifies how to perform arithmetic on field elements.

Functions§

inv
Compute -M^{-1} mod 2^64.

Type Aliases§

Fp64
Finite field with max 64 bits size element.
Fp128
Finite field with max 128 bits size element.
Fp192
Finite field with max 192 bits size element.
Fp256
Finite field with max 256 bits size element.
Fp320
Finite field with max 320 bits size element.
Fp384
Finite field with max 384 bits size element.
Fp448
Finite field with max 448 bits size element.
Fp512
Finite field with max 512 bits size element.
Fp576
Finite field with max 576 bits size element.
Fp640
Finite field with max 640 bits size element.
Fp704
Finite field with max 704 bits size element.
Fp768
Finite field with max 768 bits size element.
Fp832
Finite field with max 832 bits size element.