From 68a7a19d3b8494f32305619be13892dd19794ed5 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Tue, 2 Feb 2021 11:13:32 -0700 Subject: [PATCH] Move hashtocurve module into pasta module. --- src/arithmetic.rs | 4 +--- src/pasta.rs | 2 ++ src/{arithmetic => pasta}/hashtocurve.rs | 2 +- src/pasta/pallas.rs | 2 +- src/pasta/vesta.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename src/{arithmetic => pasta}/hashtocurve.rs (99%) diff --git a/src/arithmetic.rs b/src/arithmetic.rs index b6dc672..51a70e8 100644 --- a/src/arithmetic.rs +++ b/src/arithmetic.rs @@ -2,15 +2,13 @@ //! field and polynomial arithmetic. use crossbeam_utils::thread; -use ff::Field; +pub use ff::Field; mod curves; mod fields; -mod hashtocurve; pub use curves::*; pub use fields::*; -pub use hashtocurve::*; /// This represents an element of a group with basic operations that can be /// performed. This allows an FFT implementation (for example) to operate diff --git a/src/pasta.rs b/src/pasta.rs index c851450..a8313e3 100644 --- a/src/pasta.rs +++ b/src/pasta.rs @@ -6,11 +6,13 @@ mod macros; mod curves; mod fields; +mod hashtocurve; pub mod pallas; pub mod vesta; pub use curves::*; pub use fields::*; +use hashtocurve::*; #[test] fn test_endo_consistency() { diff --git a/src/arithmetic/hashtocurve.rs b/src/pasta/hashtocurve.rs similarity index 99% rename from src/arithmetic/hashtocurve.rs rename to src/pasta/hashtocurve.rs index 0b19376..32305b1 100644 --- a/src/arithmetic/hashtocurve.rs +++ b/src/pasta/hashtocurve.rs @@ -6,7 +6,7 @@ use core::fmt::Debug; use core::marker::PhantomData; use subtle::ConstantTimeEq; -use super::{Curve, CurveAffine, Field, FieldExt}; +use crate::arithmetic::{Curve, CurveAffine, Field, FieldExt}; /// Implementation of the "simplified SWU" hashing to short Weierstrass curves /// with a = 0. Internally uses SHAKE128. diff --git a/src/pasta/pallas.rs b/src/pasta/pallas.rs index 2361e50..5e0da73 100644 --- a/src/pasta/pallas.rs +++ b/src/pasta/pallas.rs @@ -2,8 +2,8 @@ use lazy_static::lazy_static; +use super::SimplifiedSWUWithDegree3Isogeny; use super::{Ep, EpAffine, Fp, Fq, IsoEp, IsoEpAffine}; -use crate::arithmetic::SimplifiedSWUWithDegree3Isogeny; /// The base field of the Pallas and iso-Pallas curves. pub type Base = Fp; diff --git a/src/pasta/vesta.rs b/src/pasta/vesta.rs index a2ffc8a..8dac763 100644 --- a/src/pasta/vesta.rs +++ b/src/pasta/vesta.rs @@ -2,8 +2,8 @@ use lazy_static::lazy_static; +use super::SimplifiedSWUWithDegree3Isogeny; use super::{Eq, EqAffine, Fp, Fq, IsoEq, IsoEqAffine}; -use crate::arithmetic::SimplifiedSWUWithDegree3Isogeny; /// The base field of the Vesta and iso-Vesta curves. pub type Base = Fq;