Documentation
¶
Overview ¶
Package tshare implements methods for (2,3) threshold secret sharing for splitting secrets into three shares. None of the shares alone give away any information about the secret (other than the length) but any combination of two shares is able to fully recover the secret.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Join ¶
Join recovers a secret message from two or more shares. Any one of the supplied readers can be nil and the secret will still be recovered as long as at least two are used. The reconstructed secret is written to w.
func JoinBytes ¶
JoinBytes recovers a secret message from two or more shares. Any one of the supplied arrayes can be nil and the secret will still be recovered as long as at least two are used. The reconstructed secret is written to m.
func Split ¶
Split reads from reader and splits data using (2,3) threshold secret sharing algorithm, writing each share to the respective writer.
func SplitBytes ¶
SplitBytes splits m into 3 shares using 2,3 threshold secret sharing algorithm defined by:
m = secret byte with bits [m7 m6 m5 m4 m3 m2 m1 m0] r = random byte s0 = [ 0 0 0 0 m7 m6 m5 m4] ^ r s1 = [m3 m2 m1 m0 0 0 0 0] ^ r s2 = [m7 m6 m5 m4 m3 m2 m1 m0] ^ r
Types ¶
This section is empty.