Created
September 30, 2022 16:26
-
-
Save vmx/4a80eb57c11772b6f8770f0f4b17f806 to your computer and use it in GitHub Desktop.
Multiexp Halo2/sppark comparison
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "halo2_sppark_msm" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
halo2_proofs = "0.2.0" | |
pasta-msm = "0.1.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this file into `src/main.rs` | |
use halo2_proofs::{ | |
arithmetic, | |
pasta::{EqAffine, Fp}, | |
poly::commitment::Params, | |
}; | |
fn main() { | |
let params: Params<EqAffine> = Params::new(1); | |
let g = params.get_g(); | |
let coeffs = [ | |
Fp::from_raw([ | |
0x28bf6d7e44fc29c3, | |
0x055b530532763cbb, | |
0xafbf625308db140b, | |
0x49158785832b6c31, | |
]), | |
Fp::from_raw([ | |
0x11c8228ce7911bf4, | |
0x27d3fabfce624f25, | |
0x925cda9cdf3364dd, | |
0x23c54e00b15da6fd, | |
]), | |
]; | |
let point_sppark = pasta_msm::vesta(&g, &coeffs); | |
println!("vmx: sppark: {:?}", point_sppark); | |
let point_halo2 = arithmetic::small_multiexp(&coeffs, &g); | |
println!("vmx: halo2: {:?}", point_halo2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment