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:
parent
cd74efa13d
commit
4055cb9439
|
@ -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),
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue