4 releases

0.1.2 Sep 6, 2019
0.1.1 Sep 3, 2019
0.1.0 Sep 3, 2019
0.0.0 Aug 28, 2019
Download history 12/week @ 2022-03-11 16/week @ 2022-03-18 4/week @ 2022-04-22 33/week @ 2022-04-29 24/week @ 2022-05-06 68/week @ 2022-05-13 15/week @ 2022-05-20 24/week @ 2022-05-27 28/week @ 2022-06-03 2/week @ 2022-06-17

54 downloads per month

MIT license

15KB
350 lines

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);

lib.rs:

Sharing

Use for example the Shamir implementation

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);

Dependencies

~385KB