From d2152cc97c141aa5af45745faff1773cb6d756da Mon Sep 17 00:00:00 2001 From: Andrea Date: Mon, 11 Mar 2024 17:09:49 -0700 Subject: [PATCH] Update to the latest version of ironfish-frost --- Cargo.lock | 9 ++++++++- ironfish-rust-nodejs/src/frost.rs | 17 ++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0fbccbc2c7..0e6c3b2387 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1521,7 +1521,7 @@ dependencies = [ [[package]] name = "ironfish-frost" version = "0.1.0" -source = "git+https://github.com/iron-fish/ironfish-frost.git?branch=main#18b413c75df23f9460bd143fb2d044632ef9d1c9" +source = "git+https://github.com/iron-fish/ironfish-frost.git?branch=main#ef7d975ac22a95a93fd76de0fa1f86ef545feb46" dependencies = [ "blake3", "chacha20 0.9.1", @@ -1531,6 +1531,7 @@ dependencies = [ "rand_chacha", "rand_core", "reddsa 0.5.1", + "siphasher", "x25519-dalek", ] @@ -2611,6 +2612,12 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fe458c98333f9c8152221191a77e2a44e8325d0193484af2e9421a53019e57d" +[[package]] +name = "siphasher" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54ac45299ccbd390721be55b412d41931911f654fa99e2cb8bfb57184b2061fe" + [[package]] name = "slab" version = "0.4.8" diff --git a/ironfish-rust-nodejs/src/frost.rs b/ironfish-rust-nodejs/src/frost.rs index 874145d723..f312a86911 100644 --- a/ironfish-rust-nodejs/src/frost.rs +++ b/ironfish-rust-nodejs/src/frost.rs @@ -4,7 +4,7 @@ use crate::{structs::NativeUnsignedTransaction, to_napi_err}; use ironfish::{ - frost::{keys::KeyPackage, round1::SigningCommitments, round2, Randomizer}, + frost::{keys::KeyPackage, round2, Randomizer}, frost_utils::{signing_package::SigningPackage, split_spender_key::split_spender_key}, participant::{Identity, Secret}, serializing::{bytes_to_hex, fr::FrSerializable, hex_to_vec_bytes}, @@ -58,15 +58,14 @@ pub fn create_signing_commitment( let transaction_hash = transaction_hash.into_value()?; let signers = try_deserialize_identities(signers)?; - let nonces = - deterministic_signing_nonces(key_package.signing_share(), &transaction_hash, &signers); - let commitments = SigningCommitments::from(&nonces); - - let signing_commitment = - SigningCommitment::from_frost(secret, *commitments.hiding(), *commitments.binding()); - - let bytes = signing_commitment.serialize()?; + let signing_commitment = SigningCommitment::from_secrets( + &secret, + key_package.signing_share(), + &transaction_hash, + &signers, + ); + let bytes = signing_commitment.serialize(); Ok(bytes_to_hex(&bytes[..])) }