Skip to content

Commit

Permalink
Refactoring. Remove couple of excessive assigning.
Browse files Browse the repository at this point in the history
  • Loading branch information
skaunov committed Sep 22, 2023
1 parent f28e49a commit cf92ce7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rust-k256/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down

0 comments on commit cf92ce7

Please sign in to comment.