Use upstream serder for dleq Proof

This commit is contained in:
Tobin C. Harding 2020-10-22 11:19:43 +11:00
parent ad0d8d5713
commit a0987ee2b8
4 changed files with 3 additions and 43 deletions

View File

@ -8,7 +8,7 @@ edition = "2018"
anyhow = "1"
async-trait = "0.1"
bitcoin = { version = "0.23", features = ["rand", "serde"] }
cross-curve-dleq = { git = "https://github.com/comit-network/cross-curve-dleq", rev = "3fc1726e4511d53a6cbcb91a42f479238eca688b" }
cross-curve-dleq = { git = "https://github.com/comit-network/cross-curve-dleq", rev = "1931c0436f259e1a1f53a4ec8acbbaaf614bd1e4", features = ["serde"] }
curve25519-dalek = "2"
ecdsa_fun = { git = "https://github.com/LLFourn/secp256kfun", rev = "510d48ef6a2b19805f7f5c70c598e5b03f668e7a", features = ["libsecp_compat", "serde", "serialization"] }
ed25519-dalek = { version = "1.0.0-pre.4", features = ["serde"] }# Cannot be 1 because they depend on curve25519-dalek version 3

View File

@ -3,7 +3,7 @@ use ecdsa_fun::{adaptor::EncryptedSignature, Signature};
use serde::{Deserialize, Serialize};
use std::convert::TryFrom;
use crate::{bitcoin, monero, serde::cross_curve_dleq_proof};
use crate::{bitcoin, monero};
#[derive(Debug)]
pub enum Message {
@ -17,7 +17,6 @@ pub struct Message0 {
pub(crate) A: bitcoin::PublicKey,
pub(crate) S_a_monero: monero::PublicKey,
pub(crate) S_a_bitcoin: bitcoin::PublicKey,
#[serde(with = "cross_curve_dleq_proof")]
pub(crate) dleq_proof_s_a: cross_curve_dleq::Proof,
pub(crate) v_a: monero::PrivateViewKey,
pub(crate) redeem_address: bitcoin::Address,

View File

@ -1,4 +1,4 @@
use crate::{bitcoin, monero, serde::cross_curve_dleq_proof};
use crate::{bitcoin, monero};
use anyhow::Result;
use ecdsa_fun::{adaptor::EncryptedSignature, Signature};
use serde::{Deserialize, Serialize};
@ -17,7 +17,6 @@ pub struct Message0 {
pub(crate) B: bitcoin::PublicKey,
pub(crate) S_b_monero: monero::PublicKey,
pub(crate) S_b_bitcoin: bitcoin::PublicKey,
#[serde(with = "cross_curve_dleq_proof")]
pub(crate) dleq_proof_s_b: cross_curve_dleq::Proof,
pub(crate) v_b: monero::PrivateViewKey,
pub(crate) refund_address: bitcoin::Address,

View File

@ -88,44 +88,6 @@ pub mod cross_curve_dleq_scalar {
}
}
pub mod cross_curve_dleq_proof {
use serde::{de, de::Visitor, Deserializer, Serializer};
use std::fmt;
struct MyVisitor;
impl<'de> Visitor<'de> for MyVisitor {
type Value = cross_curve_dleq::Proof;
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(formatter, "todo")
}
fn visit_bytes<E>(self, _s: &[u8]) -> Result<Self::Value, E>
where
E: de::Error,
{
todo!("visit_bytes")
}
}
pub fn serialize<S>(_x: &cross_curve_dleq::Proof, _s: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
todo!("serialize")
}
pub fn deserialize<'de, D>(
_deserializer: D,
) -> Result<cross_curve_dleq::Proof, <D as Deserializer<'de>>::Error>
where
D: Deserializer<'de>,
{
todo!("deserialize")
}
}
pub mod monero_private_key {
use serde::{de, de::Visitor, Deserializer, Serializer};
use std::fmt;