Function rusty_secrets::generate_shares [] [src]

pub fn generate_shares(k: u8, n: u8, secret: &[u8], sign_shares: bool) -> Result<Vec<String>>

Performs threshold k-out-of-n Shamir secret sharing.

Examples

use rusty_secrets::generate_shares;
let secret = "These programs were never about terrorism: they’re about economic spying,
              social control, and diplomatic manipulation. They’re about power.".to_string();

match generate_shares(7, 10, &secret.into_bytes(), true){
    Ok(shares) => {
        // Do something with the shares
    },
    Err(_) => {}// Deal with error}
}Run