Help us shape the future of Go! Take the 2026 Go Developer Survey

tshare

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2019 License: MIT Imports: 3 Imported by: 0

README

tshare GoDoc

This package implements (2,3) XOR 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.

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

func Join(w io.Writer, r0 io.Reader, r1 io.Reader, r2 io.Reader) error

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

func JoinBytes(m, s0, s1, s2 []byte) error

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

func Split(r io.Reader, w0 io.Writer, w1 io.Writer, w2 io.Writer) error

Split reads from reader and splits data using (2,3) threshold secret sharing algorithm, writing each share to the respective writer.

func SplitBytes

func SplitBytes(m, s0, s1, s2 []byte) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL