Skip to main content

shamir_split

Function shamir_split 

Source
pub fn shamir_split(
    secret: u64,
    coeffs: &[u64],
    n: usize,
    ys: &mut [u64],
) -> usize
Expand description

Split secret (reduced mod the prime) into n shares with threshold k = coeffs.len()+1: share i (x-coord i+1) y-value is written to ys[i]. coeffs are the k−1 polynomial coefficients (from a CSPRNG in production; caller-supplied here for determinism). Returns n.