mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 04:09:23 +00:00
Smash Ciphersuite definitions into their own crates
Uses dalek-ff-group for Ed25519 and Ristretto. Uses minimal-ed448 for Ed448. Adds ciphersuite-kp256 for Secp256k1 and P-256.
This commit is contained in:
@@ -23,7 +23,9 @@ zeroize = { version = "1", default-features = false }
|
||||
rand_core = { version = "0.6", default-features = false, features = ["getrandom"] }
|
||||
|
||||
curve25519-dalek = "4"
|
||||
ciphersuite = { path = "../../crypto/ciphersuite", default-features = false, features = ["secp256k1", "ristretto"] }
|
||||
dalek-ff-group = { path = "../../crypto/dalek-ff-group", default-features = false }
|
||||
ciphersuite = { path = "../../crypto/ciphersuite", default-features = false }
|
||||
ciphersuite-kp256 = { path = "../../crypto/ciphersuite/kp256", default-features = false }
|
||||
dkg = { path = "../../crypto/dkg", default-features = false }
|
||||
|
||||
bitcoin-serai = { path = "../../networks/bitcoin" }
|
||||
|
||||
@@ -5,7 +5,8 @@ use std::sync::{OnceLock, Mutex};
|
||||
use zeroize::Zeroizing;
|
||||
use rand_core::{RngCore, OsRng};
|
||||
|
||||
use ciphersuite::{group::ff::PrimeField, Ciphersuite, Ristretto};
|
||||
use dalek_ff_group::Ristretto;
|
||||
use ciphersuite::{group::ff::PrimeField, Ciphersuite};
|
||||
|
||||
use serai_client::primitives::ExternalNetworkId;
|
||||
use messages::{ProcessorMessage, CoordinatorMessage};
|
||||
|
||||
@@ -90,7 +90,7 @@ pub enum Wallet {
|
||||
},
|
||||
Ethereum {
|
||||
rpc_url: String,
|
||||
key: <ciphersuite::Secp256k1 as Ciphersuite>::F,
|
||||
key: <ciphersuite_kp256::Secp256k1 as Ciphersuite>::F,
|
||||
nonce: u64,
|
||||
},
|
||||
Monero {
|
||||
@@ -149,7 +149,8 @@ impl Wallet {
|
||||
}
|
||||
|
||||
ExternalNetworkId::Ethereum => {
|
||||
use ciphersuite::{group::ff::Field, Secp256k1};
|
||||
use ciphersuite::group::ff::Field;
|
||||
use ciphersuite_kp256::Secp256k1;
|
||||
use ethereum_serai::alloy::{
|
||||
primitives::{U256, Address},
|
||||
simple_request_transport::SimpleRequest,
|
||||
@@ -321,7 +322,7 @@ impl Wallet {
|
||||
));
|
||||
|
||||
let to_as_key = PublicKey::new(
|
||||
<ciphersuite::Secp256k1 as Ciphersuite>::read_G(&mut to.as_slice()).unwrap(),
|
||||
<ciphersuite_kp256::Secp256k1 as Ciphersuite>::read_G(&mut to.as_slice()).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
let router_addr = {
|
||||
@@ -502,7 +503,7 @@ impl Wallet {
|
||||
.unwrap()
|
||||
}
|
||||
Wallet::Ethereum { key, .. } => ExternalAddress::new(
|
||||
ethereum_serai::crypto::address(&(ciphersuite::Secp256k1::generator() * key)).into(),
|
||||
ethereum_serai::crypto::address(&(ciphersuite_kp256::Secp256k1::generator() * key)).into(),
|
||||
)
|
||||
.unwrap(),
|
||||
Wallet::Monero { view_pair, .. } => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use ciphersuite::{Ciphersuite, Ristretto};
|
||||
use dalek_ff_group::Ristretto;
|
||||
use ciphersuite::Ciphersuite;
|
||||
|
||||
use dockertest::DockerTest;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user