From 89b850f1f69fcb9606fd9b35c3546fcb3f88ded9 Mon Sep 17 00:00:00 2001 From: Joey Yandle Date: Tue, 17 Dec 2024 16:48:41 -0500 Subject: [PATCH] clear nonce after signing with the state machine --- src/state_machine/signer/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/state_machine/signer/mod.rs b/src/state_machine/signer/mod.rs index 61cefdea..78b54404 100644 --- a/src/state_machine/signer/mod.rs +++ b/src/state_machine/signer/mod.rs @@ -326,7 +326,7 @@ impl Signer { self.dkg_private_shares(dkg_private_shares, rng) } Message::SignatureShareRequest(sign_share_request) => { - self.sign_share_request(sign_share_request) + self.sign_share_request(sign_share_request, rng) } Message::NonceRequest(nonce_request) => self.nonce_request(nonce_request, rng), _ => Ok(vec![]), // TODO @@ -565,9 +565,10 @@ impl Signer { Ok(msgs) } - fn sign_share_request( + fn sign_share_request( &mut self, sign_request: &SignatureShareRequest, + rng: &mut R, ) -> Result, Error> { let mut msgs = vec![]; @@ -611,6 +612,8 @@ impl Signer { } }; + self.signer.gen_nonces(rng); + let response = SignatureShareResponse { dkg_id: sign_request.dkg_id, sign_id: sign_request.sign_id,