Skip to content

SuperInstance/secret-sharing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

si-secret-sharing

Shamir's secret sharing, verifiable secret sharing (Feldman VSS), reconstruction from subsets, and threshold variants over finite fields in Rust.

Features

  • Finite field arithmetic — modular arithmetic over large primes
  • Shamir's secret sharing — (t, n) threshold scheme
  • Feldman VSS — verifiable secret sharing with public commitments
  • Lagrange reconstruction — recover secrets from any qualifying subset
  • Threshold utilities — majority, any-two, and custom configurations

Usage

use si_secret_sharing::{ShamirScheme, Reconstructor, FiniteField};

let secret = FiniteField::from_u64(42);
let shares = ShamirScheme::split(&secret, 5, 3); // 5 shares, threshold 3

let subset: Vec<&Share> = shares.iter().take(3).collect();
let recovered = Reconstructor::lagrange_interpolate(&subset);
assert_eq!(recovered, secret);

License

MIT OR Apache-2.0

About

Shamir's secret sharing, Feldman VSS, and threshold schemes in Rust

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages