vault: github.com/hashicorp/vault/shamir Index | Files

package shamir

import "github.com/hashicorp/vault/shamir"

Index

Package Files

shamir.go tables.go

Constants

const (
    // ShareOverhead is the byte size overhead of each share
    // when using Split on a secret. This is caused by appending
    // a one byte tag to the share.
    ShareOverhead = 1
)

func Combine Uses

func Combine(parts [][]byte) ([]byte, error)

Combine is used to reverse a Split and reconstruct a secret once a `threshold` number of parts are available.

func Split Uses

func Split(secret []byte, parts, threshold int) ([][]byte, error)

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.

Package shamir imports 6 packages (graph) and is imported by 24 packages. Updated 2018-12-09. Refresh now. Tools for package owners.