From e7c421353729ed924558f20ccce0cf1cd28a2770 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Fri, 4 Dec 2020 17:22:02 -0700 Subject: [PATCH] Remove duplicative from_bytes_wide method in fq.rs; it already exists in the trait impl for FieldExt. --- src/pasta/fields/fq.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/pasta/fields/fq.rs b/src/pasta/fields/fq.rs index 88e0fea..f372f5a 100644 --- a/src/pasta/fields/fq.rs +++ b/src/pasta/fields/fq.rs @@ -248,21 +248,6 @@ impl Fq { self.add(self) } - /// Converts a 512-bit little endian integer into - /// a `Fq` by reducing by the modulus. - pub fn from_bytes_wide(bytes: &[u8; 64]) -> Fq { - Fq::from_u512([ - u64::from_le_bytes(bytes[0..8].try_into().unwrap()), - u64::from_le_bytes(bytes[8..16].try_into().unwrap()), - u64::from_le_bytes(bytes[16..24].try_into().unwrap()), - u64::from_le_bytes(bytes[24..32].try_into().unwrap()), - u64::from_le_bytes(bytes[32..40].try_into().unwrap()), - u64::from_le_bytes(bytes[40..48].try_into().unwrap()), - u64::from_le_bytes(bytes[48..56].try_into().unwrap()), - u64::from_le_bytes(bytes[56..64].try_into().unwrap()), - ]) - } - fn from_u512(limbs: [u64; 8]) -> Fq { // We reduce an arbitrary 512-bit number by decomposing it into two 256-bit digits // with the higher bits multiplied by 2^256. Thus, we perform two reductions