diff --git a/crypto/dkg/src/tests/mod.rs b/crypto/dkg/src/tests/mod.rs index 4acb6a5b..915468ff 100644 --- a/crypto/dkg/src/tests/mod.rs +++ b/crypto/dkg/src/tests/mod.rs @@ -31,6 +31,8 @@ pub fn clone_without( } /// Recover the secret from a collection of keys. +/// +/// This will panic if no keys, an insufficient amount of keys, or the wrong keys are provided. pub fn recover_key(keys: &HashMap>) -> C::F { let first = keys.values().next().expect("no keys provided"); assert!(keys.len() >= first.params().t().into(), "not enough keys provided"); diff --git a/crypto/schnorr/src/aggregate.rs b/crypto/schnorr/src/aggregate.rs index 811e8aae..d5b1d5dc 100644 --- a/crypto/schnorr/src/aggregate.rs +++ b/crypto/schnorr/src/aggregate.rs @@ -89,6 +89,8 @@ impl SchnorrAggregate { } /// Write a SchnorrAggregate to something implementing Write. + /// + /// This will panic if more than 4 billion signatures were aggregated. pub fn write(&self, writer: &mut W) -> io::Result<()> { writer.write_all( &u32::try_from(self.Rs.len()) diff --git a/crypto/schnorrkel/src/lib.rs b/crypto/schnorrkel/src/lib.rs index 1db1ca5e..7d3b3333 100644 --- a/crypto/schnorrkel/src/lib.rs +++ b/crypto/schnorrkel/src/lib.rs @@ -60,6 +60,8 @@ pub struct Schnorrkel { impl Schnorrkel { /// Create a new algorithm with the specified context. + /// + /// If the context is greater than or equal to 4 GB in size, this will panic. pub fn new(context: &'static [u8]) -> Schnorrkel { Schnorrkel { context,