You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
arnaucube c63b841899 Add blog link, small pending updates 2 years ago
..
benchmarks Implement Benchmarks for modular inverse impl 4 years ago
src Add blog link, small pending updates 2 years ago
.gitignore Add blog link, small pending updates 2 years ago
Cargo.toml Implement Benchmarks for modular inverse impl 4 years ago
LICENSE add Rust implementation, reorganize directories 4 years ago
README.md Add blog link, small pending updates 2 years ago

README.md

shamirsecretsharing-rs

Shamir's Secret Sharing in Rust

Usage

// create 6 shares from k, on the Fp
// where to recover will be needed 3 shares
let s = create(3, 6, &p, &k);

// now set 3 of the 6 shares, to be used to recover the secret
let mut shares_to_use: Vec<[BigInt;2]> = Vec::new();
shares_to_use.push(s[2].clone());
shares_to_use.push(s[1].clone());
shares_to_use.push(s[0].clone());

// recover the secret using Lagrange Interpolation
let r = lagrange_interpolation(&p, shares_to_use);
assert_eq!(k, r);
// r is the secret recovered (k)