Skip to main content

Crate miden_field

Crate miden_field 

Source
Expand description

A unified Felt for Miden Rust code.

This crate provides a single Felt type that can be used in both:

  • On-chain (Wasm + miden): Felt is backed by a Miden VM felt via compiler intrinsics.
  • Off-chain (native / non-Miden Wasm): Felt is backed by Plonky3’s Goldilocks field element.

Re-exports§

pub use word::LexicographicWord;
pub use word::Word;
pub use word::WordError;

Modules§

utils
word
A Word type used in the Miden protocol and associated utilities.

Macros§

word
Construct a new Word from a hex value.

Structs§

BinomialExtensionField
BoundedPowers
Same as Powers, but returns a bounded number of powers.
Felt
A Felt backed by Plonky3’s Goldilocks field element.
FeltFromIntError
Powers
An iterator which returns the powers of a base element b shifted by current c: c, c * b, c * b^2, ....

Traits§

Algebra
A ring R implements Algebra<F> if there is an injective homomorphism from F into R; in particular only F::ZERO maps to R::ZERO.
BasedVectorSpace
A vector space V over F with a fixed basis. Fixing the basis allows elements of V to be converted to and from DIMENSION many elements of F which are interpreted as basis coefficients.
BinomiallyExtendable
Trait for fields that support binomial extension of the form F[X]/(X^D - W).
BinomiallyExtendableAlgebra
Trait for algebras which support binomial extensions of the form A[X]/(X^D - W) with W in the base field F.
ExtensionField
A field EF which is also an algebra over a field F.
Field
A field F. This permits both modular fields ℤ/p along with their field extensions.
HasTwoAdicBinomialExtension
Trait for binomial extensions that support a two-adic subgroup generator.
InjectiveMonomial
A ring implements InjectiveMonomial<N> if the algebraic function f(x) = x^N is an injective map on elements of the ring.
Packable
A trait to constrain types that can be packed into a packed value.
PermutationMonomial
A ring implements PermutationMonomial<N> if the algebraic function f(x) = x^N is invertible and thus acts as a permutation on elements of the ring.
PrimeCharacteristicRing
A commutative ring, R, with prime characteristic, p.
PrimeField
A field isomorphic to ℤ/p for some prime p.
PrimeField64
A prime field ℤ/p with order, p < 2^64.
QuotientMap
Implementation of the quotient map ℤ -> ℤ/p which sends an integer r to its conjugacy class [r].
RawDataSerializable
A collection of methods designed to help hash field elements.
TwoAdicField
A field which supplies information like the two-adicity of its multiplicative group, and methods for obtaining two-adic generators.

Functions§

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.