mirror of
https://github.com/arnaucube/babyjubjub-ark.git
synced 2026-01-13 17:21:29 +01:00
693c7be161d573f2132e3dc8ca62202ca76e6ba7
Add [ff](https://github.com/matter-labs/ff) for internal finite field operations, and add `add-2008-bbjlp` for point addition. Benchmarks (On a Intel(R) Core(TM) i7-8705G CPU @ 3.10GHz, with 32 GB of RAM): ``` - before: add time: [53.447 us 53.467 us 53.492 us] mul_scalar time: [121.19 ms 121.22 ms 121.25 ms] sign time: [383.01 ms 384.46 ms 385.98 ms] verify time: [250.56 ms 251.46 ms 252.43 ms] - current: add time: [317.34 ns 317.44 ns 317.54 ns] mul_scalar time: [131.05 us 131.28 us 131.58 us] sign time: [973.38 us 973.83 us 974.41 us] verify time: [835.34 us 839.94 us 845.29 us] ``` add: `168x` improvement mul_scalar: `923x` improvement sign: `394x` improvement verify: `300x` improvement Still needs a refactor.
babyjubjub-rs

BabyJubJub elliptic curve implementation in Rust. A twisted edwards curve embedded in the curve of BN128/BN256.
BabyJubJub curve explanation: https://medium.com/zokrates/efficient-ecc-in-zksnarks-using-zokrates-bd9ae37b8186
Uses:
- Poseidon hash function https://github.com/arnaucube/poseidon-rs
Compatible with the BabyJubJub implementations in:
- Go, from https://github.com/iden3/go-iden3-crypto
- circom & javascript, from https://github.com/iden3/circomlib
Warning
Doing this in my free time to get familiar with Rust, do not use in production.
- point addition
- point scalar multiplication
- eddsa keys generation
- eddsa signature
- eddsa signature verification
- {point, pk, signature} compress&decompress parsers
References
- BabyJubJub curve explanation: https://medium.com/zokrates/efficient-ecc-in-zksnarks-using-zokrates-bd9ae37b8186
- C++ & Explanation https://github.com/barryWhiteHat/baby_jubjub
- Javascript & Circom: https://github.com/iden3/circomlib
- Go https://github.com/iden3/go-iden3-crypto
- JubJub curve explanation: https://z.cash/technology/jubjub/
Languages
Rust
100%