Errors caused by protocol violations should contain the misbehaving p… (#341)

Errors caused by protocol violations should contain the misbehaving party.
This commit is contained in:
David Craven 2023-05-09 03:51:29 +02:00 committed by GitHub
parent cd74efa13d
commit 4055cb9439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -46,7 +46,10 @@ pub enum Error<C: Ciphersuite> {
},
/// Secret share verification failed.
#[error("Invalid secret share.")]
InvalidSecretShare,
InvalidSecretShare {
/// The identifier of the signer whose share validation failed.
identifier: Identifier<C>,
},
/// Round 1 package not found for Round 2 participant.
#[error("Round 1 package not found for Round 2 participant.")]
PackageNotFound,
@ -61,7 +64,10 @@ pub enum Error<C: Ciphersuite> {
DKGNotSupported,
/// The proof of knowledge is not valid.
#[error("The proof of knowledge is not valid.")]
InvalidProofOfKnowledge,
InvalidProofOfKnowledge {
/// The identifier of the signer whose share validation failed.
sender: Identifier<C>,
},
/// Error in scalar Field.
#[error("Error in scalar Field.")]
FieldError(#[from] FieldError),

View File

@ -299,7 +299,9 @@ where
let result = evaluate_vss(&self.commitment, self.identifier);
if !(f_result == result) {
return Err(Error::InvalidSecretShare);
return Err(Error::InvalidSecretShare {
identifier: self.identifier,
});
}
let group_public = VerifyingKey {

View File

@ -197,7 +197,7 @@ pub fn part2<C: Ciphersuite>(
let c_ell = challenge::<C>(ell, &R_ell, &phi_ell0).ok_or(Error::DKGNotSupported)?;
if R_ell != <C::Group>::generator() * mu_ell - phi_ell0 * c_ell.0 {
return Err(Error::InvalidProofOfKnowledge);
return Err(Error::InvalidProofOfKnowledge { sender: ell });
}
// Round 2, Step 1