Documentation ¶
Overview ¶
Package shares contains functions for processing DEK shares.
Index ¶
- Constants
- func CombineShares(shares [][]byte) ([]byte, error)
- func CombineUnwrappedShares(keyCfg *configpb.KeyConfig, unwrappedShares []UnwrappedShare) ([]byte, error)
- func CreateDEKShares(dek DEK, keyCfg *configpb.KeyConfig) ([][]byte, error)
- func HashShare(share []byte) []byte
- func SplitShares(data []byte, shares, threshold int) ([][]byte, error)
- func ValidateShare(share []byte, expectedHash []byte) bool
- type DEK
- type UnwrappedShare
Constants ¶
const DEKBytes uint32 = 32
DEKBytes is the size of the DEK in bytes.
Variables ¶
This section is empty.
Functions ¶
func CombineShares ¶
CombineShares takes a list of shares and reconstitutes the original data. Note that this does not guarantee the shares are correct (SSS will succeed at "reconstructing" data from even faulty shares), so integrity checks are done separately.
func CombineUnwrappedShares ¶
func CombineUnwrappedShares(keyCfg *configpb.KeyConfig, unwrappedShares []UnwrappedShare) ([]byte, error)
CombineUnwrappedShares reconstitutes and returns the DEK from the provided shares.
func CreateDEKShares ¶
CreateDEKShares generates a DEK and - if applicable - splits it into shares.
func SplitShares ¶
SplitShares takes a DEK as `data`, and returns a slice of byte slices, each representing one of the n shares.
func ValidateShare ¶
ValidateShare performs HashShare on the provided share, then returns whether the result is equal to the provided hash.
Types ¶
type UnwrappedShare ¶
type UnwrappedShare struct {}
UnwrappedShare represents an unwrapped share and its associated external URI.