Skip to content

Commit

Permalink
clear nonce after signing with the state machine
Browse files Browse the repository at this point in the history
  • Loading branch information
xoloki committed Dec 17, 2024
1 parent c4c6e69 commit 89b850f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/state_machine/signer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ impl<SignerType: SignerTrait> Signer<SignerType> {
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
Expand Down Expand Up @@ -565,9 +565,10 @@ impl<SignerType: SignerTrait> Signer<SignerType> {
Ok(msgs)
}

fn sign_share_request(
fn sign_share_request<R: RngCore + CryptoRng>(
&mut self,
sign_request: &SignatureShareRequest,
rng: &mut R,
) -> Result<Vec<Message>, Error> {
let mut msgs = vec![];

Expand Down Expand Up @@ -611,6 +612,8 @@ impl<SignerType: SignerTrait> Signer<SignerType> {
}
};

self.signer.gen_nonces(rng);

let response = SignatureShareResponse {
dkg_id: sign_request.dkg_id,
sign_id: sign_request.sign_id,
Expand Down

0 comments on commit 89b850f

Please sign in to comment.