@blockchaincommons/shamir - Shamir's Secret Sharing over GF(2^8) with a
four-byte HMAC checksum, the scheme SSKR is built on.
splitSecret turns a 16–32 byte secret into shareCountShamirShares, any threshold of which recoverSecret
turns back. Validation and checksum failures throw ShamirError.
Its codes include the reference's eight variants and InvalidParameter
for a threshold, shareCount or share index that is not a usize
(a safe non-negative integer number, or a bigint in [0, 2^64 - 1])
and for an argument of the wrong type. Randomness is drawn through
@blockchaincommons/rand, so a generator's own error, including rand's
RandError for a malformed generator, propagates unwrapped.
@blockchaincommons/shamir - Shamir's Secret Sharing over GF(2^8) with a four-byte HMAC checksum, the scheme SSKR is built on.
splitSecret turns a 16–32 byte secret into
shareCountShamirShares, anythresholdof which recoverSecret turns back. Validation and checksum failures throw ShamirError. Its codes include the reference's eight variants andInvalidParameterfor athreshold,shareCountor shareindexthat is not ausize(a safe non-negative integernumber, or abigintin[0, 2^64 - 1]) and for an argument of the wrong type. Randomness is drawn through@blockchaincommons/rand, so a generator's own error, including rand'sRandErrorfor a malformed generator, propagates unwrapped.