pub struct ShamirSecretSharingExtended {
pub p: u64,
pub t: usize,
pub n: usize,
}Expand description
Extended Shamir secret sharing with explicit reconstruction from arbitrary shares.
§WARNING
Educational only. Small prime field.
Fields§
§p: u64Prime field modulus
t: usizeThreshold t
n: usizeNumber of shares n
Implementations§
Source§impl ShamirSecretSharingExtended
impl ShamirSecretSharingExtended
Share the secret using the provided polynomial coefficients a[1..t]. Returns n shares as (x_i, y_i) pairs.
Sourcepub fn reconstruct(&self, shares: &[(u64, u64)]) -> u64
pub fn reconstruct(&self, shares: &[(u64, u64)]) -> u64
Reconstruct from any t shares using Lagrange interpolation mod p.
Trait Implementations§
Source§impl Clone for ShamirSecretSharingExtended
impl Clone for ShamirSecretSharingExtended
Source§fn clone(&self) -> ShamirSecretSharingExtended
fn clone(&self) -> ShamirSecretSharingExtended
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShamirSecretSharingExtended
impl RefUnwindSafe for ShamirSecretSharingExtended
impl Send for ShamirSecretSharingExtended
impl Sync for ShamirSecretSharingExtended
impl Unpin for ShamirSecretSharingExtended
impl UnsafeUnpin for ShamirSecretSharingExtended
impl UnwindSafe for ShamirSecretSharingExtended
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