Must be Split
Hash reference, containing elements K and N. N is the total number of secret shares, whereas K denotes the number of shares required to reveal the secret.
If a hash reference is given with the named parameter BITLENGTH given, the parameter is used as the bitlength of the secret. If no parameter is given, the default bitlength of 128 is used. Note that the maximum bitlength is 1024, as it is saved in the secret shares.
Returns an array containing N secret shares of which K must be fed to set_secret in order to reveal the (randomly generated) secret.
The secret shares are uppercase hexadecimal strings of the following format:
A First nibble (= first character): version number of the format,
currently fixed to 0. B Next byte (next two characters) : x-coordinate of the point used
for interpolation B Next variable length of bytes : y-coordinate of the point used
for interpolation C Next two bytes : the two highest bytes of the SHA1-hash
on the string representing the y-coordinates D Next two bytes : bitlength of the prime number in nibbles
Actually, the algorithm always uses the smallest prime number of bitlength 4*D + 1. This is useful as so, little space is wasted for saving the prime number. Note that the prime number is not a security parameter, so it may be known publicly.
The part of the SHA-1 hash (C) is used as a checksum to safeguard against typos.
Returns true once enough secret shares are available to compute the secret.
Returns the complete secret or undef if not yet available.
Sets (part of) the secret. Accepts a secret share string generated by compute().
|perl v5.20.3||OPENXPKI::CRYPTO::SECRET::SPLIT (3)||2016-04-03|