mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 19:49:22 +00:00
Fix Ethereum, again
This commit is contained in:
parent
1e201562df
commit
62dfc63532
3 changed files with 8 additions and 7 deletions
|
@ -12,7 +12,7 @@ use ethers::{
|
||||||
use frost::{
|
use frost::{
|
||||||
curve::Secp256k1,
|
curve::Secp256k1,
|
||||||
Participant,
|
Participant,
|
||||||
algorithm::Schnorr as Algo,
|
algorithm::IetfSchnorr,
|
||||||
tests::{key_gen, algorithm_machines, sign},
|
tests::{key_gen, algorithm_machines, sign},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ async fn test_ecrecover_hack() {
|
||||||
|
|
||||||
let full_message = &[chain_id.to_be_byte_array().as_slice(), &hashed_message].concat();
|
let full_message = &[chain_id.to_be_byte_array().as_slice(), &hashed_message].concat();
|
||||||
|
|
||||||
let algo = Algo::<Secp256k1, crypto::EthereumHram>::new();
|
let algo = IetfSchnorr::<Secp256k1, crypto::EthereumHram>::ietf();
|
||||||
let sig = sign(
|
let sig = sign(
|
||||||
&mut OsRng,
|
&mut OsRng,
|
||||||
algo.clone(),
|
algo.clone(),
|
||||||
|
|
|
@ -36,7 +36,7 @@ fn test_ecrecover() {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_signing() {
|
fn test_signing() {
|
||||||
use frost::{
|
use frost::{
|
||||||
algorithm::Schnorr,
|
algorithm::IetfSchnorr,
|
||||||
tests::{algorithm_machines, key_gen, sign},
|
tests::{algorithm_machines, key_gen, sign},
|
||||||
};
|
};
|
||||||
use rand_core::OsRng;
|
use rand_core::OsRng;
|
||||||
|
@ -46,12 +46,12 @@ fn test_signing() {
|
||||||
|
|
||||||
const MESSAGE: &[u8] = b"Hello, World!";
|
const MESSAGE: &[u8] = b"Hello, World!";
|
||||||
|
|
||||||
let algo = Schnorr::<Secp256k1, EthereumHram>::new();
|
let algo = IetfSchnorr::<Secp256k1, EthereumHram>::ietf();
|
||||||
let _sig = sign(
|
let _sig = sign(
|
||||||
&mut OsRng,
|
&mut OsRng,
|
||||||
algo,
|
algo,
|
||||||
keys.clone(),
|
keys.clone(),
|
||||||
algorithm_machines(&mut OsRng, Schnorr::<Secp256k1, EthereumHram>::new(), &keys),
|
algorithm_machines(&mut OsRng, IetfSchnorr::<Secp256k1, EthereumHram>::ietf(), &keys),
|
||||||
MESSAGE,
|
MESSAGE,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ fn test_signing() {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_ecrecover_hack() {
|
fn test_ecrecover_hack() {
|
||||||
use frost::{
|
use frost::{
|
||||||
algorithm::Schnorr,
|
algorithm::IetfSchnorr,
|
||||||
tests::{algorithm_machines, key_gen, sign},
|
tests::{algorithm_machines, key_gen, sign},
|
||||||
};
|
};
|
||||||
use rand_core::OsRng;
|
use rand_core::OsRng;
|
||||||
|
@ -76,7 +76,7 @@ fn test_ecrecover_hack() {
|
||||||
|
|
||||||
let full_message = &[chain_id.to_be_byte_array().as_slice(), &hashed_message].concat();
|
let full_message = &[chain_id.to_be_byte_array().as_slice(), &hashed_message].concat();
|
||||||
|
|
||||||
let algo = Schnorr::<Secp256k1, EthereumHram>::new();
|
let algo = IetfSchnorr::<Secp256k1, EthereumHram>::ietf();
|
||||||
let sig = sign(
|
let sig = sign(
|
||||||
&mut OsRng,
|
&mut OsRng,
|
||||||
algo.clone(),
|
algo.clone(),
|
||||||
|
|
|
@ -39,6 +39,7 @@ dleq = { path = "../dleq", version = "0.2", features = ["serialize"] }
|
||||||
dkg = { path = "../dkg", version = "0.2" }
|
dkg = { path = "../dkg", version = "0.2" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
hex = "0.4"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
|
||||||
dkg = { path = "../dkg", version = "0.2", features = ["tests"] }
|
dkg = { path = "../dkg", version = "0.2", features = ["tests"] }
|
||||||
|
|
Loading…
Reference in a new issue