[−][src]Crate sharks
Fast, small and secure Shamir's Secret Sharing library crate
Usage example:
use sharks::{ Sharks, Share }; // Set a minimum threshold of 10 shares let sharks = Sharks(10); // Obtain an iterator over the shares for secret [1, 2, 3, 4] let dealer = sharks.dealer(&[1, 2, 3, 4]); // Get 10 shares let shares: Vec<Share> = dealer.take(10).collect(); // Recover the original secret! let secret = sharks.recover(shares.as_slice()).unwrap(); assert_eq!(secret, vec![1, 2, 3, 4]);
Structs
Share | A share used to reconstruct the secret. Can be serialized to and from a byte array. |
Sharks | Tuple struct which implements methods to generate shares and recover secrets over a 256 bits Galois Field. Its only parameter is the minimum shares threshold. |