Skip to content

Commit

Permalink
Style
Browse files Browse the repository at this point in the history
  • Loading branch information
skaunov committed Oct 27, 2023
1 parent daa7c04 commit 1cfa817
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rust-k256/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ impl PlumeSignature<'_> {
let hashed_to_curve = hash_to_curve(self.message, self.pk);
let hashed_to_curve_r = &hashed_to_curve * self.s - self.nullifier * &c_scalar;

// Check if the given hash matches
let result = |components: Vec<&ProjectivePoint>| -> bool {
if &c_sha256_vec_signal(components) == c {
true
} else {
false
}
};

if let Some(PlumeSignatureV1Fields {
r_point: sig_r_point,
hashed_to_curve_r: sig_hashed_to_curve_r,
Expand All @@ -140,7 +141,6 @@ impl PlumeSignature<'_> {
return false;
}

// Check if the given hash matches
result(vec![
&ProjectivePoint::GENERATOR,
self.pk,
Expand All @@ -150,7 +150,6 @@ impl PlumeSignature<'_> {
&hashed_to_curve_r,
])
} else {
// Check if the given hash matches
result(vec![self.nullifier, &r_point, &hashed_to_curve_r])
}
}
Expand Down

0 comments on commit 1cfa817

Please sign in to comment.