Documentation ¶
Index ¶
- func NewReader(readers map[byte]io.Reader) (io.Reader, error)
- func NewWriter(parts, threshold int, factory func(x byte) (io.Writer, error)) (io.Writer, error)
- type ShamirHelper
- func (instance *ShamirHelper) Combine(parts map[byte][]byte) ([]byte, error)
- func (instance *ShamirHelper) CombineFromDir(dir string) ([]byte, error)
- func (instance *ShamirHelper) CombineFromFiles(files []string) ([]byte, error)
- func (instance *ShamirHelper) Split(secret []byte, parts, threshold int) (map[byte][]byte, error)
- func (instance *ShamirHelper) SplitToFiles(secret []byte, parts, threshold int, dir string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ShamirHelper ¶
type ShamirHelper struct { }
var Shamir *ShamirHelper
func (*ShamirHelper) Combine ¶
func (instance *ShamirHelper) Combine(parts map[byte][]byte) ([]byte, error)
Combine is used to reverse a Split and reconstruct a secret once a `threshold` number of parts are available.
func (*ShamirHelper) CombineFromDir ¶
func (instance *ShamirHelper) CombineFromDir(dir string) ([]byte, error)
func (*ShamirHelper) CombineFromFiles ¶
func (instance *ShamirHelper) CombineFromFiles(files []string) ([]byte, error)
func (*ShamirHelper) Split ¶
Split takes an arbitrarily long secret and generates a `parts` number of shares, `threshold` of which are required to reconstruct the secret. The parts and threshold must be at least 2, and less than 256. The returned shares are each one byte longer than the secret as they attach a tag used to reconstruct the secret.
func (*ShamirHelper) SplitToFiles ¶
Click to show internal directories.
Click to hide internal directories.