This crate contains modules with cryptographic operations needed in STARK proof generation and verification.
Hash module defines a set of hash functions available for cryptographic operations. Currently, two hash functions are supported: BLAKE3 and SHA3. Support of additional hash functions is planned, including arithmetization-friendly hash functions such as Rescue.
Merkle module contains an implementation of a Merkle tree which supports batch proof generation and verification. Batch proofs are based on the Octopus algorithm described here.
This crate can be compiled with the following features:
std
- enabled by default and relies on the Rust standard library.std
+concurrent
- same asstd
but enables multi-threaded execution for some of the crate functions.no_std
+alloc
- does not rely on the Rust standard library and enables compilation to WebAssembly.
When compiled with concurrent
feature enabled, the following operations will be executed in multiple threads:
MerkleTree::new()
- i.e., a Merkle tree will be constructed 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.
To compile this crate to WebAssembly, disable default features and enable the alloc
feature.
This project is MIT licensed.