Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidSyntax = errors.New("invalid syntax in share")
ErrInvalidSyntax is returned if a share isn't formatted as a number, hyphen and string.
Functions ¶
func Combine ¶
Combine points via Lagrange interpolation to form the secret, provided a number of points equivalent to the threshold are supplied.
func ShareToString ¶
ShareToString returns a nicely formatted hexadecimal representation of a share.
Types ¶
type Point ¶
Point in the polynomial.
func FixedSplit ¶ added in v1.1.0
FixedSplit works like Split, with the option to specify a prime to use. This allows uniform share lengths across different input sizes. The prime still needs to be larger than the secret, and will be adjusted accordingly.
func Split ¶
SplitSecret into n parts, requiring threshold t parts to recover it. secret should be relatively small, otherwise the resulting shares end up huge. threshold must be minimum 2, and will be silently increased to 2 if less. n should be higher than t, and will be corrected to t+1 if not.
The resulting slice of points will be numbered from 1 and up.
func StringToShare ¶
StringToShare will split a share string into a Point.