From 48d1663676f7cc4dab05dc66217b2f46b203b9f6 Mon Sep 17 00:00:00 2001 From: Hanting Zhang Date: Mon, 8 Jan 2024 03:12:00 +0000 Subject: [PATCH 1/4] add grumpkin-pasta bindings --- Cargo.toml | 10 +++++----- src/provider/pasta.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b6ff8187d..919baa008 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,10 +48,10 @@ 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 +# pasta-msm = { git = "https://github.com/lurk-lab/pasta-msm", branch = "dev", version = "0.1.4" } +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"] } @@ -108,7 +108,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"] diff --git a/src/provider/pasta.rs b/src/provider/pasta.rs index f24a894dc..a2977a884 100644 --- a/src/provider/pasta.rs +++ b/src/provider/pasta.rs @@ -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) } From bc3a7e058e26d4acab53a939bcefe01009139932 Mon Sep 17 00:00:00 2001 From: Hanting Zhang Date: Mon, 8 Jan 2024 03:20:47 +0000 Subject: [PATCH 2/4] allow gpu-ci --- .github/workflows/gpu-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gpu-ci.yml b/.github/workflows/gpu-ci.yml index 053114e03..5864268a3 100644 --- a/.github/workflows/gpu-ci.yml +++ b/.github/workflows/gpu-ci.yml @@ -14,7 +14,7 @@ concurrency: jobs: cuda: name: Rust tests on CUDA - if: github.event_name != 'pull_request' || github.event.action == 'enqueued' + # if: github.event_name != 'pull_request' || github.event.action == 'enqueued' runs-on: [self-hosted, gpu-ci] steps: - uses: actions/checkout@v4 @@ -36,7 +36,7 @@ jobs: opencl: name: Rust tests on OpenCL - if: github.event_name != 'pull_request' || github.event.action == 'enqueued' + # if: github.event_name != 'pull_request' || github.event.action == 'enqueued' runs-on: [self-hosted, gpu-ci] steps: - uses: actions/checkout@v4 From a3cb91ff4ea4e0912e8f54524b11edc9680160b2 Mon Sep 17 00:00:00 2001 From: Hanting Zhang Date: Mon, 8 Jan 2024 04:28:35 +0000 Subject: [PATCH 3/4] revert gpu-ci --- .github/workflows/gpu-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gpu-ci.yml b/.github/workflows/gpu-ci.yml index 5864268a3..053114e03 100644 --- a/.github/workflows/gpu-ci.yml +++ b/.github/workflows/gpu-ci.yml @@ -14,7 +14,7 @@ concurrency: jobs: cuda: name: Rust tests on CUDA - # if: github.event_name != 'pull_request' || github.event.action == 'enqueued' + if: github.event_name != 'pull_request' || github.event.action == 'enqueued' runs-on: [self-hosted, gpu-ci] steps: - uses: actions/checkout@v4 @@ -36,7 +36,7 @@ jobs: opencl: name: Rust tests on OpenCL - # if: github.event_name != 'pull_request' || github.event.action == 'enqueued' + if: github.event_name != 'pull_request' || github.event.action == 'enqueued' runs-on: [self-hosted, gpu-ci] steps: - uses: actions/checkout@v4 From 9b6ea4aa2d73e642dd6e6236ce4bd2d0b38a65cf Mon Sep 17 00:00:00 2001 From: Hanting Zhang Date: Mon, 8 Jan 2024 06:52:08 -0800 Subject: [PATCH 4/4] Update Cargo.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: François Garillot <4142+huitseeker@users.noreply.github.com> --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 919baa008..d29406c9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,6 @@ derive_more = "0.99.17" [target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64"))'.dependencies] # grumpkin-msm has been patched to support MSMs for the pasta curve cycle # see: https://github.com/lurk-lab/grumpkin-msm/pull/3 -# pasta-msm = { git = "https://github.com/lurk-lab/pasta-msm", branch = "dev", version = "0.1.4" } grumpkin-msm = { git = "https://github.com/lurk-lab/grumpkin-msm", branch = "dev" } [target.'cfg(not(target_arch = "wasm32"))'.dependencies]