From 683952d8c7b3bec0c3711f5f04db7fe53316a831 Mon Sep 17 00:00:00 2001 From: Iraklis Leontiadis Date: Tue, 15 Aug 2023 10:26:28 +0300 Subject: [PATCH 1/2] init --- Cargo.toml | 2 +- src/ecdsa/two_party/party1.rs | 2 ++ src/ecdsa/two_party/party2.rs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a1560c9..7997cfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,4 +11,4 @@ edition = "2021" [dependencies] rand = "0.8" serde = { version = "1", features = ["derive"] } -two-party-ecdsa = { git = "https://github.com/ZenGo-X/two-party-ecdsa.git" } +two-party-ecdsa = { git = "https://github.com/ZenGo-X/two-party-ecdsa.git" ,branch = "party1-msg1-rand-range"} diff --git a/src/ecdsa/two_party/party1.rs b/src/ecdsa/two_party/party1.rs index 48a53fd..b13a171 100644 --- a/src/ecdsa/two_party/party1.rs +++ b/src/ecdsa/two_party/party1.rs @@ -32,6 +32,7 @@ pub struct KeyGenParty1Message2 { pub ecdh_second_message: party_one::KeyGenSecondMsg, pub ek: EncryptionKey, pub c_key: BigInt, + pub encrypted_share_minus_q_thirds: BigInt, pub correct_key_proof: NICorrectKeyProof, pub range_proof: RangeProofNi, } @@ -131,6 +132,7 @@ impl MasterKey1 { ecdh_second_message: key_gen_second_message, ek: paillier_key_pair.ek.clone(), c_key: paillier_key_pair.encrypted_share.clone(), + encrypted_share_minus_q_thirds:paillier_key_pair.encrypted_share_minus_q_thirds.clone(), correct_key_proof, range_proof, }, diff --git a/src/ecdsa/two_party/party2.rs b/src/ecdsa/two_party/party2.rs index ea50650..ddf2e5f 100644 --- a/src/ecdsa/two_party/party2.rs +++ b/src/ecdsa/two_party/party2.rs @@ -115,7 +115,7 @@ impl MasterKey2 { (), > { let paillier_encryption_key = party_one_second_message.ek.clone(); - let paillier_encrypted_share = party_one_second_message.c_key.clone(); + let paillier_encrypted_share = party_one_second_message.encrypted_share_minus_q_thirds.clone(); let party_two_second_message = party_two::KeyGenSecondMsg::verify_commitments_and_dlog_proof( From 67ae47f74dfaa33b4264351a9b8afca400f6f3e5 Mon Sep 17 00:00:00 2001 From: Iraklis Leontiadis Date: Tue, 15 Aug 2023 11:00:23 +0300 Subject: [PATCH 2/2] debug --- src/ecdsa/two_party/party2.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ecdsa/two_party/party2.rs b/src/ecdsa/two_party/party2.rs index ddf2e5f..dc0cb0f 100644 --- a/src/ecdsa/two_party/party2.rs +++ b/src/ecdsa/two_party/party2.rs @@ -123,7 +123,7 @@ impl MasterKey2 { &party_one_second_message.ecdh_second_message, ); - let party_two_paillier = party_two::PaillierPublic { + let mut party_two_paillier = party_two::PaillierPublic { ek: paillier_encryption_key.clone(), encrypted_secret_share: paillier_encrypted_share.clone(), }; @@ -132,7 +132,7 @@ impl MasterKey2 { &party_two_paillier, &party_one_second_message.range_proof, ); - + party_two_paillier.encrypted_secret_share = party_one_second_message.c_key.clone(); let (pdl_first_message, pdl_chal) = party_two_paillier.pdl_challenge( &party_one_second_message .ecdh_second_message