Document a pair of panics requiring 256 GB of RAM/4 GB of a context

This commit is contained in:
Luke Parker
2023-04-24 23:49:06 -04:00
parent 7a8f8c2d3d
commit 09d96822ca
3 changed files with 6 additions and 0 deletions

View File

@@ -31,6 +31,8 @@ pub fn clone_without<K: Clone + std::cmp::Eq + std::hash::Hash, V: Clone>(
}
/// 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<C: Ciphersuite>(keys: &HashMap<Participant, ThresholdKeys<C>>) -> C::F {
let first = keys.values().next().expect("no keys provided");
assert!(keys.len() >= first.params().t().into(), "not enough keys provided");