Skip to content

Commit 02ff07a

Browse files
committed
Move ComplaintResponse into avss; drop unused generic parameter
1 parent 1a3591c commit 02ff07a

2 files changed

Lines changed: 11 additions & 19 deletions

File tree

fastcrypto-tbls/src/threshold_schnorr/avss.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::nodes::{Nodes, PartyId};
1414
use crate::polynomial::{Eval, Poly};
1515
use crate::random_oracle::RandomOracle;
1616
use crate::threshold_schnorr::bcs::BCSSerialized;
17-
use crate::threshold_schnorr::complaint::{ComplaintResponse, RecoveryProof};
17+
use crate::threshold_schnorr::complaint::RecoveryProof;
1818
use crate::threshold_schnorr::Extensions::Encryption;
1919
use crate::threshold_schnorr::{random_oracle_from_sid, EG, G, S};
2020
use crate::types;
@@ -71,6 +71,14 @@ pub struct Complaint {
7171
pub proof: RecoveryProof,
7272
}
7373

74+
/// A response to a [Complaint], containing the responder's shares so the accuser can
75+
/// Lagrange-interpolate their own.
76+
#[derive(Debug, Clone, Serialize, Deserialize)]
77+
pub struct ComplaintResponse {
78+
pub responder_id: PartyId,
79+
pub shares: SharesForNode,
80+
}
81+
7482
/// The output of a receiver after a single instance of AVSS: The shares for each nonce + commitments for the next round.
7583
#[derive(Debug, Clone, Serialize, Deserialize)]
7684
pub struct PartialOutput {
@@ -311,7 +319,7 @@ impl Receiver {
311319
message: &Message,
312320
complaint: &Complaint,
313321
my_output: &PartialOutput,
314-
) -> FastCryptoResult<ComplaintResponse<SharesForNode>> {
322+
) -> FastCryptoResult<ComplaintResponse> {
315323
complaint.proof.check(
316324
complaint.accuser_id,
317325
&self.nodes.node_id_to_node(complaint.accuser_id)?.pk,
@@ -333,7 +341,7 @@ impl Receiver {
333341
pub fn recover(
334342
&self,
335343
message: &Message,
336-
responses: Vec<ComplaintResponse<SharesForNode>>,
344+
responses: Vec<ComplaintResponse>,
337345
) -> FastCryptoResult<PartialOutput> {
338346
// Sanity check that we have enough responses (by weight) to recover the shares.
339347
let total_response_weight = self

fastcrypto-tbls/src/threshold_schnorr/complaint.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,3 @@ impl RecoveryProof {
8080
))
8181
}
8282
}
83-
84-
/// A response to a complaint, containing the responder's shares.
85-
#[derive(Debug, Clone, Serialize, Deserialize)]
86-
pub struct ComplaintResponse<S> {
87-
pub(crate) responder_id: PartyId,
88-
pub(crate) shares: S,
89-
}
90-
91-
impl<S> ComplaintResponse<S> {
92-
pub fn new(responder_id: PartyId, shares: S) -> Self {
93-
Self {
94-
responder_id,
95-
shares,
96-
}
97-
}
98-
}

0 commit comments

Comments
 (0)