Crate p3_field

Source
Expand description

A framework for finite fields.

Modules§

extension

Structs§

FieldArray
Powers
An iterator which returns the powers of a base element b shifted by current c: c, c * b, c * b^2, ....

Traits§

ExtensionField
Field
An element of a finite field.
FieldAlgebra
A commutative algebra over a finite field.
FieldExtensionAlgebra
A commutative algebra over an extension field.
Packable
A trait to constrain types that can be packed into a packed value.
PackedField
Safety
PackedFieldPow2
Safety
PackedValue
Safety
PrimeField
PrimeField32
A prime field of order less than 2^32.
PrimeField64
A prime field of order less than 2^64.
TwoAdicField
A field which supplies information like the two-adicity of its multiplicative group, and methods for obtaining two-adic generators.

Functions§

add_scaled_slice_in_place
x += y * s, where s is a scalar.
add_vecs
batch_multiplicative_inverse
Batch multiplicative inverses with Montgomery’s trick This is Montgomery’s trick. At a high level, we invert the product of the given field elements, then derive the individual inverses from that via multiplication.
binomial_expand
Expand a product of binomials (x - roots[0])(x - roots[1]).. into polynomial coefficients.
cyclic_subgroup_coset_known_order
Computes a coset of a multiplicative subgroup whose order is known in advance.
cyclic_subgroup_known_order
Computes a multiplicative subgroup whose order is known in advance.
dot_product
Maximally generic dot product.
eval_poly
exp_1420470955
exp_1717986917
exp_1725656503
exp_10540996611094048183
exp_u64_by_squaring
field_to_array
Extend a field FA element x to an array of length D by filling zeros.
halve_u32
Given an element x from a 32 bit field F_P compute x/2.
halve_u64
Given an element x from a 64 bit field F_P compute x/2.
naive_poly_mul
Naive polynomial multiplication.
reduce_32
Given a slice of SF elements, reduce them to a TF element using a 2^32-base decomposition.
scale_slice_in_place
scale_vec
split_32
Given an SF element, split it to a vector of TF elements using a 2^64-base decomposition.
sum_vecs
two_adic_coset_zerofier
Computes Z_{sH}(x), where Z_{sH} is the zerofier of the given coset of a multiplicative subgroup of order 2^log_n.
two_adic_subgroup_zerofier
Computes Z_H(x), where Z_H is the zerofier of a multiplicative subgroup of order 2^log_n.