From cf92ce7c7d530359ca05e9cfaa5d232b44305856 Mon Sep 17 00:00:00 2001 From: skaunov Date: Fri, 22 Sep 2023 22:19:53 +0300 Subject: [PATCH] Refactoring. Remove couple of excessive assigning. --- rust-k256/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rust-k256/src/lib.rs b/rust-k256/src/lib.rs index 36561dd..c3ed26e 100644 --- a/rust-k256/src/lib.rs +++ b/rust-k256/src/lib.rs @@ -58,8 +58,7 @@ fn sha256hash_vec_signal(values: &[ProjectivePoint]) -> Scalar { let sha512_hasher_result = sha256_hasher.finalize(); //256 bit hash let bytes = FieldBytes::from_iter(sha512_hasher_result.iter().copied()); - let scalar_res = Scalar::from_repr(bytes).unwrap(); - scalar_res + Scalar::from_repr(bytes).unwrap() } fn sha256hash6signals( @@ -86,8 +85,7 @@ fn sha256hash6signals( let sha512_hasher_result = sha256_hasher.finalize(); //512 bit hash let c_bytes = FieldBytes::from_iter(sha512_hasher_result.iter().copied()); - let c_scalar = Scalar::from_repr(c_bytes).unwrap(); - c_scalar + Scalar::from_repr(c_bytes).unwrap() } // Calls the hash to curve function for secp256k1, and returns the result as a ProjectivePoint