Function rusty_secrets::sss::recover_secret [−][src]
pub fn recover_secret(
shares: &[String],
verify_signatures: bool
) -> Result<Vec<u8>>
Recovers the secret from a k-out-of-n Shamir's secret sharing scheme.
At least k
distinct shares need to be provided to recover the secret.
Examples
use rusty_secrets::sss::recover_secret; let share1 = "2-1-Cha7s14Q/mSwWko0ittr+/Uf79RHQMIP".to_string(); let share2 = "2-4-ChaydsUJDypD9ZWxwvIICh/cmZvzusOF".to_string(); let shares = vec![share1, share2]; match recover_secret(&shares, false) { Ok(secret) => { // Do something with the secret }, Err(e) => { // Deal with the error } }