Skip to main content

join_shares

Function join_shares 

Source
pub fn join_shares<'a, I, J>(shares: I) -> Result<Vec<u8>>
where I: IntoIterator<Item = &'a Share, IntoIter = J>, J: Iterator<Item = &'a Share> + Clone,
Expand description

Join multiple Share to regenerate a secret key.

§Arguments

  • shares - The Shares to join

§Example

use devolutions_crypto::secret_sharing::{generate_shared_key, join_shares, SecretSharingVersion};
let shares = generate_shared_key(5, 3, 32, SecretSharingVersion::Latest).unwrap();

assert_eq!(shares.len(), 5);

let key = join_shares(&shares[2..5]).unwrap();