This crate contains modules with mathematical operations needed in STARK proof generation and verification.
Finite field module implements arithmetic operations in STARK-friendly finite fields. The operation include:
Currently, there are two implementations of finite fields:
Currently, the library provides a generic way to create quadratic extensions of STARK fields. An extension element is defined as α + β * φ, where φ is a root of the polynomial x2 - x - 1, and α and β are base field elements.
Support for cubic extension fields is not yet available.
Polynomials module implements basic polynomial operations such as:
FFT module contains operations for computing Fast Fourier transform in a prime field (also called Number-theoretic transform). This can be used to interpolate and evaluate polynomials in O(n log n) time as long as the domain of the polynomial is a multiplicative subgroup with size which is a power of 2.
This crate can be compiled with the following features:
std
- enabled by default and relies on the Rust standard library.std
+ concurrent
- same as std
but enables multi-threaded execution for some of the crate functions.no_std
+ alloc
- does not rely on Rust's standard library and enables compilation to WebAssembly.When compiled with concurrent
feature enabled, the following operations will be executed in multiple threads:
evaluate_poly()
evaluate_poly_with_offset()
interpolate_poly()
interpolate_poly_with_offset()
get_twiddles()
get_inv_twiddles()
get_power_series()
get_power_series_with_offset()
add_in_place()
mul_acc()
batch_inversion()
The number of threads can be configured via RAYON_NUM_THREADS
environment variable, and usually defaults to the number of logical cores on the machine.
To compile this crate to WebAssembly, disable default features and enable the alloc
feature.
This project is MIT licensed.