I originally wrote this library for the genSTARK project, but it evolved into a pretty nifty stand-alone module. The library is here:
High-level features are:
- Basic modular arithmetic (addition, subtraction, multiplication, inversion, exponentiation).
- Bulk operations on vectors and matrixes.
- Basic polynomial operations (addition, subtraction, multiplication, division).
- Polynomial evaluation and interpolation (using Lagrange and FFT methods).
At this point, only prime fields are supported.
One of the cool features of the library is a flexible optimization architecture. It is pretty simple to write optimization modules for different types of fields.
|Operations/sec||JS BigInt (256-bit)||JS BigInt (128-bit)||WASM (128-bit)|
WASM performance can be optimized further. Specifically, SIMD and multi-threaded evaluation is something that I’m planning to implement at some point in the future (once support for these in WASM becomes more mature). But even as is, I believe the numbers are within 2x - 4x of what can be achieved with a native C implementation.
The library is still very new, and there are a bunch of things to fix and improve (see the issues in the repo). So, would appreciate any feedback, help, and support.