s4

package
v0.0.0-...-76ae421 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reconstruct

func Reconstruct(shares []Share) ([]byte, error)

Reconstruct takes a set of shares and tries to recover the secret from those shares

Types

type Share

type Share struct {
	// X is the x value of the share
	X byte
	// RequiredShares holds the threshold this share was generated for
	RequiredShares byte
	// Index is the index of this share
	Index byte
	// Values contains a list of y values, that were computed using (a different) f(x) = y for each secret byte
	Values []byte
}

Share holds all information a share has

func DecodeBase64Share

func DecodeBase64Share(b64 string) (Share, error)

DecodeBase64Share will try to decode a Share from a Base64 encoded string

func Split

func Split(secret []byte, k, n byte) ([]Share, error)

Split splits a secret into n shares where the threshold k applies

func (Share) GetBase64

func (s Share) GetBase64() string

GetBase64 will return this share as a Base64-encoded string

func (Share) Print

func (s Share) Print()

Print will print this share in a human readable form to the standard output

Jump to

Keyboard shortcuts

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