pub struct ShamirSS;Expand description
Shamir Secret Sharing implementation. This struct provides static methods for splitting and joining secrets using Shamir’s algorithm.
Implementations§
Source§impl ShamirSS
impl ShamirSS
Sourcepub fn split(
n: i32,
k: i32,
secret: Vec<u8>,
) -> Result<BTreeMap<i32, Vec<u8>>, String>
pub fn split( n: i32, k: i32, secret: Vec<u8>, ) -> Result<BTreeMap<i32, Vec<u8>>, String>
Splits a secret into n shares, requiring at least k shares to reconstruct the secret.
§Arguments
n- Total shares to generate (up to 255).k- Threshold needed to reconstruct (must be > 1).secret- The secret data as a byte vector.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShamirSS
impl RefUnwindSafe for ShamirSS
impl Send for ShamirSS
impl Sync for ShamirSS
impl Unpin for ShamirSS
impl UnwindSafe for ShamirSS
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more