Skip to content

Commit 9aa89d6

Browse files
committed
fix signature (bis bis bis)
1 parent 78868b3 commit 9aa89d6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

frost-secp256k1-tr/src/lib.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,13 @@ impl Ciphersuite for Secp256K1Sha256 {
360360
}
361361

362362
let mut kp = key_package.clone();
363-
let tweaked_pubkey = tweaked_public_key(key_package.verifying_key().element(), &[]);
364-
if tweaked_pubkey.to_affine().y_is_odd().into() {
363+
let public_key = key_package.verifying_key();
364+
let pubkey_is_odd = public_key.y_is_odd();
365+
let tweaked_pubkey_is_odd = tweaked_public_key(public_key.element(), &[])
366+
.to_affine()
367+
.y_is_odd()
368+
.into();
369+
if pubkey_is_odd != tweaked_pubkey_is_odd {
365370
kp.negate_signing_share();
366371
}
367372

0 commit comments

Comments
 (0)