Skip to content

Commit

Permalink
Remove more unnecessary to_vec()
Browse files Browse the repository at this point in the history
  • Loading branch information
nabetti1720 committed Nov 25, 2024
1 parent 095d5ac commit 2a9a2ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/llrt_crypto/src/subtle/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn sign(ctx: &Ctx<'_>, algorithm: &Algorithm, key: &[u8], data: &[u8]) -> Re
let mut hasher = Sha256::new();
hasher.update(data);

let hashed = hasher.finalize()[..].to_vec();
let hashed = hasher.finalize();

Ok(private_key
.sign(Pkcs1v15Sign::new::<Sha256>(), &hashed)
Expand All @@ -42,7 +42,7 @@ pub fn sign(ctx: &Ctx<'_>, algorithm: &Algorithm, key: &[u8], data: &[u8]) -> Re
let mut hasher = Sha256::new();
hasher.update(data);

let hashed = hasher.finalize()[..].to_vec();
let hashed = hasher.finalize();

Ok(private_key
.sign_with_rng(
Expand Down

0 comments on commit 2a9a2ab

Please sign in to comment.