Winter math

This crate contains modules with mathematical operations needed in STARK proof generation and verification.

Finite field

Finite field module implements arithmetic operations in STARK-friendly finite fields. The operation include:

Currently, there are two implementations of finite fields:

Extension fields

Currently, the library provides a generic way to create quadratic and cubic extensions of supported STARK fields. This can be done by implementing 'ExtensibleField' trait for degrees 2 and 3.

Quadratic extension fields are defined using the following irreducible polynomials: * For f62 field, the polynomial is x2 - x - 1. * For f64 field, the polynomial is x2 - x + 2. * For f128 field, the polynomial is x2 - x - 1.

Cubic extension fields are defined using the following irreducible polynomials: * For f62 field, the polynomial is x3 + 2x + 2. * For f64 field, the polynomial is x3 - x - 1. * For f128 field, cubic extensions are not supported.

Polynomials

Polynomials module implements basic polynomial operations such as:

Fast Fourier transform

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.

Crate features

This crate can be compiled with the following features:

To compile with no_std, disable default features via --no-default-features flag.

Concurrent execution

When compiled with concurrent feature enabled, the following operations will be executed in multiple threads:

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.

License

This project is MIT licensed.