mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-25 07:29:32 -05:00
Merge #1142
1142: deps(build): upgrade ecdsa_fun and sigma_fun r=delta1 a=delta1 - #1139 - #1140 Co-authored-by: Byron Hambly <bhambly@blockstream.com>
This commit is contained in:
commit
d588f9dcdd
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -980,7 +980,7 @@ checksum = "5caaa75cbd2b960ff1e5392d2cfb1f44717fffe12fc1f32b7b5d1267f99732a6"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ecdsa_fun"
|
name = "ecdsa_fun"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
source = "git+https://github.com/LLFourn/secp256kfun#7c3d592bae20cd4b4309ed6cf6551dc971fed43e"
|
source = "git+https://github.com/LLFourn/secp256kfun#8b2f3012e151cbab5296ec3bdc4510d3404dad75"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"rand_chacha 0.3.1",
|
"rand_chacha 0.3.1",
|
||||||
@ -3416,7 +3416,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "secp256kfun"
|
name = "secp256kfun"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
source = "git+https://github.com/LLFourn/secp256kfun#7c3d592bae20cd4b4309ed6cf6551dc971fed43e"
|
source = "git+https://github.com/LLFourn/secp256kfun#8b2f3012e151cbab5296ec3bdc4510d3404dad75"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"digest 0.10.3",
|
"digest 0.10.3",
|
||||||
"rand_core 0.6.2",
|
"rand_core 0.6.2",
|
||||||
@ -3625,7 +3625,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "sigma_fun"
|
name = "sigma_fun"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
source = "git+https://github.com/LLFourn/secp256kfun#7c3d592bae20cd4b4309ed6cf6551dc971fed43e"
|
source = "git+https://github.com/LLFourn/secp256kfun#8b2f3012e151cbab5296ec3bdc4510d3404dad75"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"curve25519-dalek-ng",
|
"curve25519-dalek-ng",
|
||||||
"digest 0.10.3",
|
"digest 0.10.3",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use crate::bitcoin::Scalar;
|
use crate::bitcoin::Scalar;
|
||||||
use ecdsa_fun::fun::marker::{Mark, NonZero, Secret};
|
use ecdsa_fun::fun::marker::{NonZero, Secret};
|
||||||
|
|
||||||
pub trait ScalarExt {
|
pub trait ScalarExt {
|
||||||
fn to_secpfun_scalar(&self) -> ecdsa_fun::fun::Scalar;
|
fn to_secpfun_scalar(&self) -> ecdsa_fun::fun::Scalar;
|
||||||
@ -14,7 +14,7 @@ impl ScalarExt for crate::monero::Scalar {
|
|||||||
|
|
||||||
ecdsa_fun::fun::Scalar::from_bytes(big_endian_bytes)
|
ecdsa_fun::fun::Scalar::from_bytes(big_endian_bytes)
|
||||||
.expect("valid scalar")
|
.expect("valid scalar")
|
||||||
.mark::<NonZero>()
|
.non_zero()
|
||||||
.expect("non-zero scalar")
|
.expect("non-zero scalar")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,17 +2,15 @@ use proptest::prelude::*;
|
|||||||
|
|
||||||
pub mod ecdsa_fun {
|
pub mod ecdsa_fun {
|
||||||
use super::*;
|
use super::*;
|
||||||
use ::ecdsa_fun::fun::marker::{Mark, NonZero, Normal};
|
|
||||||
use ::ecdsa_fun::fun::{Point, Scalar, G};
|
use ::ecdsa_fun::fun::{Point, Scalar, G};
|
||||||
|
|
||||||
pub fn point() -> impl Strategy<Value = Point> {
|
pub fn point() -> impl Strategy<Value = Point> {
|
||||||
scalar()
|
scalar().prop_map(|mut scalar| Point::even_y_from_scalar_mul(G, &mut scalar).normalize())
|
||||||
.prop_map(|mut scalar| Point::even_y_from_scalar_mul(G, &mut scalar).mark::<Normal>())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn scalar() -> impl Strategy<Value = Scalar> {
|
pub fn scalar() -> impl Strategy<Value = Scalar> {
|
||||||
prop::array::uniform32(0..255u8).prop_filter_map("generated the 0 element", |bytes| {
|
prop::array::uniform32(0..255u8).prop_filter_map("generated the 0 element", |bytes| {
|
||||||
Scalar::from_bytes_mod_order(bytes).mark::<NonZero>()
|
Scalar::from_bytes_mod_order(bytes).non_zero()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ use crate::{bitcoin, monero};
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use conquer_once::Lazy;
|
use conquer_once::Lazy;
|
||||||
use ecdsa_fun::fun::marker::Mark;
|
|
||||||
use libp2p::{Multiaddr, PeerId};
|
use libp2p::{Multiaddr, PeerId};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sha2::Sha256;
|
use sha2::Sha256;
|
||||||
@ -22,7 +21,7 @@ pub static CROSS_CURVE_PROOF_SYSTEM: Lazy<
|
|||||||
CrossCurveDLEQ<HashTranscript<Sha256, rand_chacha::ChaCha20Rng>>,
|
CrossCurveDLEQ<HashTranscript<Sha256, rand_chacha::ChaCha20Rng>>,
|
||||||
> = Lazy::new(|| {
|
> = Lazy::new(|| {
|
||||||
CrossCurveDLEQ::<HashTranscript<Sha256, rand_chacha::ChaCha20Rng>>::new(
|
CrossCurveDLEQ::<HashTranscript<Sha256, rand_chacha::ChaCha20Rng>>::new(
|
||||||
(*ecdsa_fun::fun::G).mark::<ecdsa_fun::fun::marker::Normal>(),
|
(*ecdsa_fun::fun::G).normalize(),
|
||||||
curve25519_dalek::constants::ED25519_BASEPOINT_POINT,
|
curve25519_dalek::constants::ED25519_BASEPOINT_POINT,
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user