Skip to content

lperlaki/sharing-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sharing

Secret Sharing and Inforamtion Disporsal Sharing

Use for example the Shamir implementation

Example

use sharing::{ShamirSecretSharing, Sharing};

let data = [1, 2, 3, 4, 5].to_vec();

let sharer = ShamirSecretSharing::new(5, 3, rand::thread_rng());

let shares = sharer.share(data.clone()).unwrap();
// You only need 3 out of the 5 shares to reconstruct
let rec = sharer.recontruct(shares[1..=3].to_vec()).unwrap();

assert_eq!(data, rec);

Releases

No releases published

Packages

No packages published

Languages