mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-08 14:32:24 -04:00
Update cross-curve-dleq dependency
Making build times considerably faster. On my machine, after running `cargo clean`, `cargo build -p swap` takes 2min 19s. The updated dependency also comes with a critical fix to the `Scalar` type, which originally wrongly assumed that secp256k1 and ed25519 scalars had the same endianness. For this reason, we now have to reverse the bytes of recovered scalars if we are to use them on a different chain. Finally, there is no need to append `RUST_MIN_STACK=100000000` to avoid stack overflows in tests and when running the binary.
This commit is contained in:
parent
713658244d
commit
4790d701e5
8 changed files with 23 additions and 30 deletions
|
@ -8,12 +8,7 @@ use bitcoin::{
|
|||
util::psbt::PartiallySignedTransaction,
|
||||
SigHash,
|
||||
};
|
||||
use ecdsa_fun::{
|
||||
adaptor::Adaptor,
|
||||
fun::{Point, Scalar},
|
||||
nonce::Deterministic,
|
||||
ECDSA,
|
||||
};
|
||||
use ecdsa_fun::{adaptor::Adaptor, fun::Point, nonce::Deterministic, ECDSA};
|
||||
use miniscript::{Descriptor, Segwitv0};
|
||||
use rand::{CryptoRng, RngCore};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -22,7 +17,7 @@ use std::str::FromStr;
|
|||
|
||||
pub use crate::bitcoin::transactions::{TxCancel, TxLock, TxPunish, TxRedeem, TxRefund};
|
||||
pub use bitcoin::{Address, Amount, OutPoint, Transaction, Txid};
|
||||
pub use ecdsa_fun::{adaptor::EncryptedSignature, Signature};
|
||||
pub use ecdsa_fun::{adaptor::EncryptedSignature, fun::Scalar, Signature};
|
||||
|
||||
pub const TX_FEE: u64 = 10_000;
|
||||
|
||||
|
@ -102,6 +97,12 @@ impl From<Scalar> for SecretKey {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<SecretKey> for Scalar {
|
||||
fn from(sk: SecretKey) -> Self {
|
||||
sk.inner
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Scalar> for PublicKey {
|
||||
fn from(scalar: Scalar) -> Self {
|
||||
let ecdsa = ECDSA::<()>::default();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue