diff --git a/crypto/dkg/src/promote.rs b/crypto/dkg/src/promote.rs index 8f42c19d..4d9325b5 100644 --- a/crypto/dkg/src/promote.rs +++ b/crypto/dkg/src/promote.rs @@ -16,12 +16,6 @@ use crate::{Participant, DkgError, ThresholdCore, ThresholdKeys, validate_map}; /// Promote a set of keys to another Ciphersuite definition. pub trait CiphersuitePromote { - #[doc(hidden)] - #[allow(non_snake_case)] - fn _bound_C2(_c2: C2) { - panic!() - } - fn promote(self) -> ThresholdKeys; } diff --git a/crypto/frost/src/lib.rs b/crypto/frost/src/lib.rs index c6f6916f..47862c61 100644 --- a/crypto/frost/src/lib.rs +++ b/crypto/frost/src/lib.rs @@ -26,6 +26,9 @@ pub mod tests; /// Various errors possible during signing. #[derive(Clone, Copy, PartialEq, Eq, Debug, Error)] pub enum FrostError { + #[error("internal error: {0}")] + InternalError(&'static str), + #[error("invalid participant (0 < participant <= {0}, yet participant is {1})")] InvalidParticipant(u16, Participant), #[error("invalid signing set ({0})")] diff --git a/crypto/frost/src/sign.rs b/crypto/frost/src/sign.rs index 86070add..0c94284b 100644 --- a/crypto/frost/src/sign.rs +++ b/crypto/frost/src/sign.rs @@ -516,6 +516,8 @@ impl> SignatureMachine for AlgorithmSign } // If everyone has a valid share, and there were enough participants, this should've worked - panic!("everyone had a valid share yet the signature was still invalid"); + // The only known way to cause this, for valid parameters/algorithms, is to deserialize a + // semantically invalid FrostKeys + Err(FrostError::InternalError("everyone had a valid share yet the signature was still invalid")) } }