Function sss_rs::basic_sharing::from_secret[][src]

pub fn from_secret(
    secret: u8,
    shares_required: u8,
    shares_to_create: u8,
    rand: Option<&mut dyn RngCore>
) -> Result<Vec<(u8, u8)>, Error>
Expand description

Creates a vector of points that serve as the list of shares for a given byte of data.

secret: The secret value that is to be split into shares

shares_required: The number of shares required to recreate the secret

shares_to_create: The number of shares to create, so any number ‘x’ shares from the total ‘y’ shares are enough to recreate the secret. If < shares_required, it’s automatically bumped up.

rand: The rng source for the generated coefficients in the sharing process. The default is StdRng::from_entropy()

NOTE: Using predictable RNG can be a security risk. If unsure, use None.