mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-11 05:29:25 +00:00
Don't offset nonces yet negate to achieve an even Y coordinate
Replaces an iterative loop with an immediate result, if action is necessary.
This commit is contained in:
@@ -2,7 +2,6 @@ use rand_core::OsRng;
|
||||
|
||||
use secp256k1::{Secp256k1 as BContext, Message, schnorr::Signature};
|
||||
|
||||
use k256::Scalar;
|
||||
use frost::{
|
||||
curve::Secp256k1,
|
||||
Participant,
|
||||
@@ -11,7 +10,8 @@ use frost::{
|
||||
|
||||
use crate::{
|
||||
bitcoin::hashes::{Hash as HashTrait, sha256::Hash},
|
||||
crypto::{x_only, make_even, Schnorr},
|
||||
crypto::{x_only, Schnorr},
|
||||
wallet::tweak_keys,
|
||||
};
|
||||
|
||||
#[test]
|
||||
@@ -20,8 +20,7 @@ fn test_algorithm() {
|
||||
const MESSAGE: &[u8] = b"Hello, World!";
|
||||
|
||||
for keys in keys.values_mut() {
|
||||
let (_, offset) = make_even(keys.group_key());
|
||||
*keys = keys.offset(Scalar::from(offset));
|
||||
*keys = tweak_keys(keys.clone());
|
||||
}
|
||||
|
||||
let algo = Schnorr::new();
|
||||
|
||||
Reference in New Issue
Block a user