NOTE: Modular inversion is not constant time.
Checkout master branch:
cargo bench --bench benchmark -- --save-baseline master
cargo bench --bench benchmark -- --baseline master
open target/criterion/report/index.html
cargo install cargo-instruments
cargo instruments --release --bench benchmark --open
- Make function
const fn
. - Integrate a fuzzer.
- Implement more algoritms: https://en.wikipedia.org/wiki/Template:Number-theoretic_algorithms
- Migrate to libcore https://doc.rust-lang.org/core/
- Perfomance optimized for Native and WebAssembly
- Generality
- Later: Constant-time operations.
- Prefer
const fn
over procedural macros.
For optimization, there are a few different scenarios:
- Programmer time known fields.
- Compiler time known fields.
- Statically runtime known fields.
- Dynamically runtime known fields.
- A sophisticated rust implementation of Curve25519. https://github.com/dalek-cryptography/curve25519-dalek
- A rust library for constant time algorithms. https://github.com/dalek-cryptography/subtle
- Probably the most tuned curve out there.
https://github.com/bitcoin-core/secp256k1
- Rust bindings: https://crates.io/crates/secp256k1
- Rust port: https://crates.io/crates/libsecp256k1
- A fork of secp256k1 favouring performance over constant-timeness. https://github.com/llamasoft/secp256k1_fast_unsafe
- ZCash implementation of Sappling: https://github.com/zkcrypto/bellman
- Fast implementation of zksnark in java https://github.com/scipr-lab/dizk