From 4c86de5e1007e2ad32c28351432a5ca0a0fb3b10 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 24 Nov 2022 09:33:21 +0000 Subject: [PATCH] Remove `FieldExt` bound from `SqrtHasher` generic argument --- src/arithmetic/fields.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arithmetic/fields.rs b/src/arithmetic/fields.rs index 46b9a85..52ec2b8 100644 --- a/src/arithmetic/fields.rs +++ b/src/arithmetic/fields.rs @@ -60,14 +60,14 @@ pub trait FieldExt: ff::PrimeField + Ord + Group { #[cfg(feature = "sqrt-table")] #[cfg_attr(docsrs, doc(cfg(feature = "sqrt-table")))] #[derive(Debug)] -struct SqrtHasher { +struct SqrtHasher { hash_xor: u32, hash_mod: usize, marker: PhantomData, } #[cfg(feature = "sqrt-table")] -impl SqrtHasher { +impl SqrtHasher { /// Returns a perfect hash of x for use with SqrtTables::inv. fn hash(&self, x: &F) -> usize { // This is just the simplest constant-time perfect hash construction that could @@ -82,7 +82,7 @@ impl SqrtHasher { #[cfg(feature = "sqrt-table")] #[cfg_attr(docsrs, doc(cfg(feature = "sqrt-table")))] #[derive(Debug)] -pub(crate) struct SqrtTables { +pub(crate) struct SqrtTables { hasher: SqrtHasher, inv: Vec, g0: Box<[F; 256]>, @@ -92,7 +92,7 @@ pub(crate) struct SqrtTables { } #[cfg(feature = "sqrt-table")] -impl SqrtTables { +impl SqrtTables { /// Build tables given parameters for the perfect hash. pub fn new(hash_xor: u32, hash_mod: usize) -> Self { use alloc::vec;