From 188afec4f41b90a6fb819a899eb2554047d9eb8c Mon Sep 17 00:00:00 2001 From: Jonathan Wang <31040440+jonathanpwang@users.noreply.github.com> Date: Wed, 24 Jan 2024 21:38:33 -0500 Subject: [PATCH 1/2] chore: impl scalar field for ed25519 --- halo2-base/src/utils/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/halo2-base/src/utils/mod.rs b/halo2-base/src/utils/mod.rs index 98d80870..c470a8f1 100644 --- a/halo2-base/src/utils/mod.rs +++ b/halo2-base/src/utils/mod.rs @@ -386,6 +386,7 @@ mod scalar_field_impls { use crate::ff::PrimeField; use crate::halo2_proofs::halo2curves::{ bn256::{Fq as bn254Fq, Fr as bn254Fr}, + ed25519::{Fq as ed25519Fq, Fr as ed25519Fr}, secp256k1::{Fp as secpFp, Fq as secpFq}, }; @@ -451,6 +452,8 @@ mod scalar_field_impls { impl_scalar_field!(bn254Fq); impl_scalar_field!(secpFp); impl_scalar_field!(secpFq); + impl_scalar_field!(ed25519Fq); + impl_scalar_field!(ed25519Fr); } /// Module for reading parameters for Halo2 proving system from the file system. From 932a427d6f2b39ff5988b5ce0e9aef3001c72468 Mon Sep 17 00:00:00 2001 From: Jonathan Wang <31040440+jonathanpwang@users.noreply.github.com> Date: Wed, 24 Jan 2024 21:44:42 -0500 Subject: [PATCH 2/2] chore: remove patch, add feature gate --- halo2-base/src/utils/mod.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/halo2-base/src/utils/mod.rs b/halo2-base/src/utils/mod.rs index c470a8f1..4f63caeb 100644 --- a/halo2-base/src/utils/mod.rs +++ b/halo2-base/src/utils/mod.rs @@ -386,7 +386,6 @@ mod scalar_field_impls { use crate::ff::PrimeField; use crate::halo2_proofs::halo2curves::{ bn256::{Fq as bn254Fq, Fr as bn254Fr}, - ed25519::{Fq as ed25519Fq, Fr as ed25519Fr}, secp256k1::{Fp as secpFp, Fq as secpFq}, }; @@ -452,8 +451,15 @@ mod scalar_field_impls { impl_scalar_field!(bn254Fq); impl_scalar_field!(secpFp); impl_scalar_field!(secpFq); - impl_scalar_field!(ed25519Fq); - impl_scalar_field!(ed25519Fr); + + #[cfg(feature = "halo2-axiom")] + mod ed25519 { + use super::*; + use crate::halo2_proofs::halo2curves::ed25519::{Fq, Fr}; + + impl_scalar_field!(Fq); + impl_scalar_field!(Fr); + } } /// Module for reading parameters for Halo2 proving system from the file system.