From b5fea8d1bbead3654e59d403968eea74467691a8 Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Wed, 6 Oct 2021 11:24:24 -0700 Subject: [PATCH] addressed comments --- src/field/secp256k1.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/field/secp256k1.rs b/src/field/secp256k1.rs index 42784706..41bdd6ac 100644 --- a/src/field/secp256k1.rs +++ b/src/field/secp256k1.rs @@ -46,9 +46,9 @@ impl Secp256K1Base { val.to_u64_digits() .into_iter() .pad_using(4, |_| 0) - .collect::>()[..4] + .collect::>()[..] .try_into() - .expect("error converting to u64 array; should never happen"), + .expect("error converting to u64 array"), ) } } @@ -69,9 +69,7 @@ impl Eq for Secp256K1Base {} impl Hash for Secp256K1Base { fn hash(&self, state: &mut H) { - self.to_canonical_biguint() - .iter_u64_digits() - .for_each(|digit| state.write_u64(digit)) + self.to_canonical_biguint().hash(state) } } @@ -108,7 +106,7 @@ impl Field for Secp256K1Base { // Sage: `g = GF(p).multiplicative_generator()` const MULTIPLICATIVE_GROUP_GENERATOR: Self = Self([5, 0, 0, 0]); - // Sage: `g_2 = g^((p - 1) / 2^32)` + // Sage: `g_2 = g^((p - 1) / 2)` const POWER_OF_TWO_GENERATOR: Self = Self::NEG_ONE; fn order() -> BigUint {