From 0f081c74e9f17340dc0bf71ca2b972926fe299d3 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 18 Mar 2021 15:04:07 +1300 Subject: [PATCH 1/2] Bump halo2 dependency to include pasta_curves extraction --- Cargo.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d02b324f..7158e3eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,10 +25,17 @@ blake2b_simd = "0.5" ff = "0.9" fpe = "0.4" group = "0.9" -halo2 = { git = "https://github.com/zcash/halo2.git", branch = "main" } nonempty = "0.6" subtle = "2.3" +[dependencies.halo2] +git = "https://github.com/zcash/halo2.git" +rev = "b079624ea78b4a07d44cb3c725dd734093577062" + +[dependencies.pasta_curves] +git = "https://github.com/zcash/pasta_curves.git" +rev = "0a6b2f6eb5acbe1dabc9e77ed0bcb748cc640196" + [dependencies.reddsa] git = "https://github.com/str4d/redjubjub.git" rev = "f8ff124a52d86e122e0705e8e9272f2099fe4c46" From 3911fb32023f98d96bff78e51b7b7780d6b70d23 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 18 Mar 2021 15:06:16 +1300 Subject: [PATCH 2/2] Use Pallas directly from pasta_curves crate --- src/keys.rs | 3 ++- src/primitives/sinsemilla.rs | 3 ++- src/spec.rs | 9 ++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/keys.rs b/src/keys.rs index 0801014d..afb0e3aa 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -6,7 +6,8 @@ use std::mem; use aes::Aes256; use fpe::ff1::{BinaryNumeralString, FF1}; use group::GroupEncoding; -use halo2::{arithmetic::FieldExt, pasta::pallas}; +use halo2::arithmetic::FieldExt; +use pasta_curves::pallas; use subtle::CtOption; use crate::{ diff --git a/src/primitives/sinsemilla.rs b/src/primitives/sinsemilla.rs index d31b2d8e..9699f244 100644 --- a/src/primitives/sinsemilla.rs +++ b/src/primitives/sinsemilla.rs @@ -1,7 +1,8 @@ //! The Sinsemilla hash function and commitment scheme. use group::Group; -use halo2::{arithmetic::CurveExt, pasta::pallas}; +use halo2::arithmetic::CurveExt; +use pasta_curves::pallas; use crate::spec::extract_p; diff --git a/src/spec.rs b/src/spec.rs index 8e7fa29e..b2445223 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -5,10 +5,8 @@ use std::iter; use blake2b_simd::Params; use ff::PrimeField; use group::{Curve, Group}; -use halo2::{ - arithmetic::{CurveAffine, CurveExt, FieldExt}, - pasta::pallas, -}; +use halo2::arithmetic::{CurveAffine, CurveExt, FieldExt}; +use pasta_curves::pallas; use crate::{constants::L_ORCHARD_BASE, primitives::sinsemilla}; @@ -113,7 +111,8 @@ pub(crate) fn extract_p(point: &pallas::Point) -> pallas::Base { #[cfg(test)] mod tests { use group::Group; - use halo2::{arithmetic::CurveExt, pasta::pallas}; + use halo2::arithmetic::CurveExt; + use pasta_curves::pallas; #[test] fn diversify_hash_substitution() {