From a14eccc13d3742e13ef97d178f954c4096ce03cc Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Sat, 20 Feb 2021 21:51:32 +0000 Subject: [PATCH] Remove unused hash support for Pasta Fp and Fq. Signed-off-by: Daira Hopwood --- src/pasta/curves.rs | 9 --------- src/pasta/fields/fp.rs | 2 +- src/pasta/fields/fq.rs | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/pasta/curves.rs b/src/pasta/curves.rs index e5816f9..966d04a 100644 --- a/src/pasta/curves.rs +++ b/src/pasta/curves.rs @@ -3,7 +3,6 @@ use core::cmp; use core::fmt::Debug; -use core::hash::{Hash, Hasher}; use core::ops::{Add, Mul, Neg, Sub}; use ff::Field; use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption}; @@ -650,14 +649,6 @@ macro_rules! new_curve_impl { } } - impl Hash for $name_affine { - fn hash(&self, state: &mut H) { - self.x.hash(state); - self.y.hash(state); - bool::from(self.infinity).hash(state) - } - } - impl_binops_additive!($name, $name); impl_binops_additive!($name, $name_affine); impl_binops_additive_specify_output!($name_affine, $name_affine, $name); diff --git a/src/pasta/fields/fp.rs b/src/pasta/fields/fp.rs index 1a26a59..4a09c78 100644 --- a/src/pasta/fields/fp.rs +++ b/src/pasta/fields/fp.rs @@ -16,7 +16,7 @@ use crate::arithmetic::{adc, mac, sbb, FieldExt, Group, SqrtTables}; // The internal representation of this type is four 64-bit unsigned // integers in little-endian order. `Fp` values are always in // Montgomery form; i.e., Fp(a) = aR mod p, with R = 2^256. -#[derive(Clone, Copy, Eq, Hash)] +#[derive(Clone, Copy, Eq)] pub struct Fp(pub(crate) [u64; 4]); impl fmt::Debug for Fp { diff --git a/src/pasta/fields/fq.rs b/src/pasta/fields/fq.rs index 81fcdfb..f03cb79 100644 --- a/src/pasta/fields/fq.rs +++ b/src/pasta/fields/fq.rs @@ -16,7 +16,7 @@ use crate::arithmetic::{adc, mac, sbb, FieldExt, Group, SqrtTables}; // The internal representation of this type is four 64-bit unsigned // integers in little-endian order. `Fq` values are always in // Montgomery form; i.e., Fq(a) = aR mod q, with R = 2^256. -#[derive(Clone, Copy, Eq, Hash)] +#[derive(Clone, Copy, Eq)] pub struct Fq(pub(crate) [u64; 4]); impl fmt::Debug for Fq {