Skip to content

Commit

Permalink
Add Grumpkin-Pasta bindings (#241)
Browse files Browse the repository at this point in the history
* add grumpkin-pasta bindings

* allow gpu-ci

* revert gpu-ci

* Update Cargo.toml

Co-authored-by: François Garillot <[email protected]>

---------

Co-authored-by: Hanting Zhang <[email protected]>
Co-authored-by: François Garillot <[email protected]>
  • Loading branch information
3 people authored Jan 8, 2024
1 parent a63bf11 commit 6857e50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ ref-cast = "1.0.20"
derive_more = "0.99.17"

[target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64"))'.dependencies]
pasta-msm = { git = "https://github.com/lurk-lab/pasta-msm", branch = "dev", version = "0.1.4" }
# pasta-msm also calls into sppark, which defines the same common sorting code this crate would:
# the `dont-implement-sort` feature avoids creating conflicting symbols.
grumpkin-msm = { git = "https://github.com/lurk-lab/grumpkin-msm", branch = "dev", features = ["dont-implement-sort"] }
# grumpkin-msm has been patched to support MSMs for the pasta curve cycle
# see: https://github.com/lurk-lab/grumpkin-msm/pull/3
grumpkin-msm = { git = "https://github.com/lurk-lab/grumpkin-msm", branch = "dev" }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
halo2curves = { version = "0.5.0", features = ["bits", "derive_serde", "multicore"] }
Expand Down Expand Up @@ -108,7 +107,7 @@ default = []
abomonate = []
asm = ["halo2curves/asm"]
# Compiles in portable mode, w/o ISA extensions => binary can be executed on all systems.
portable = ["pasta-msm/portable"]
portable = ["grumpkin-msm/portable"]
cuda = ["neptune/cuda", "neptune/pasta", "neptune/arity24"]
opencl = ["neptune/opencl", "neptune/pasta", "neptune/arity24"]
flamegraph = ["pprof/flamegraph", "pprof/criterion"]
Expand Down
2 changes: 1 addition & 1 deletion src/provider/pasta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ macro_rules! impl_traits {
fn vartime_multiscalar_mul(scalars: &[Self::ScalarExt], bases: &[Self::Affine]) -> Self {
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
if scalars.len() >= 128 {
pasta_msm::$name(bases, scalars)
grumpkin_msm::pasta::$name(bases, scalars)
} else {
cpu_best_msm(bases, scalars)
}
Expand Down

0 comments on commit 6857e50

Please sign in to comment.