Fix Ethereum, again

This commit is contained in:
Luke Parker 2023-03-07 06:25:21 -05:00
parent 1e201562df
commit 62dfc63532
No known key found for this signature in database
3 changed files with 8 additions and 7 deletions

View file

@ -12,7 +12,7 @@ use ethers::{
use frost::{
curve::Secp256k1,
Participant,
algorithm::Schnorr as Algo,
algorithm::IetfSchnorr,
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 algo = Algo::<Secp256k1, crypto::EthereumHram>::new();
let algo = IetfSchnorr::<Secp256k1, crypto::EthereumHram>::ietf();
let sig = sign(
&mut OsRng,
algo.clone(),

View file

@ -36,7 +36,7 @@ fn test_ecrecover() {
#[test]
fn test_signing() {
use frost::{
algorithm::Schnorr,
algorithm::IetfSchnorr,
tests::{algorithm_machines, key_gen, sign},
};
use rand_core::OsRng;
@ -46,12 +46,12 @@ fn test_signing() {
const MESSAGE: &[u8] = b"Hello, World!";
let algo = Schnorr::<Secp256k1, EthereumHram>::new();
let algo = IetfSchnorr::<Secp256k1, EthereumHram>::ietf();
let _sig = sign(
&mut OsRng,
algo,
keys.clone(),
algorithm_machines(&mut OsRng, Schnorr::<Secp256k1, EthereumHram>::new(), &keys),
algorithm_machines(&mut OsRng, IetfSchnorr::<Secp256k1, EthereumHram>::ietf(), &keys),
MESSAGE,
);
}
@ -59,7 +59,7 @@ fn test_signing() {
#[test]
fn test_ecrecover_hack() {
use frost::{
algorithm::Schnorr,
algorithm::IetfSchnorr,
tests::{algorithm_machines, key_gen, sign},
};
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 algo = Schnorr::<Secp256k1, EthereumHram>::new();
let algo = IetfSchnorr::<Secp256k1, EthereumHram>::ietf();
let sig = sign(
&mut OsRng,
algo.clone(),

View file

@ -39,6 +39,7 @@ dleq = { path = "../dleq", version = "0.2", features = ["serialize"] }
dkg = { path = "../dkg", version = "0.2" }
[dev-dependencies]
hex = "0.4"
serde_json = "1"
dkg = { path = "../dkg", version = "0.2", features = ["tests"] }