Skip to content

Commit

Permalink
Merge pull request #33 from skaunov/refactoring_assignments
Browse files Browse the repository at this point in the history
Refactoring. Remove couple of excessive assigning.
  • Loading branch information
skaunov authored Sep 23, 2023
2 parents ccd26a8 + cf92ce7 commit 1484d6a
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 1484d6a

Please sign in to comment.