Documentation ¶
Index ¶
- Variables
- func Decrypt(key, nonce, associated, ciphertext []byte) (message []byte, err error)
- func EdSign(key, message []byte) (signature []byte, pubkey ed25519.PublicKey, err error)
- func EdVerify(pubkey, message, signature []byte) (ok bool)
- func Encrypt(key, nonce, associated, message []byte) (ciphertext []byte, err error)
- func RandomKey() (key []byte)
- func ReedSolomonEncode(data []byte, threshold, total int) (split [][]byte, err error)
- func ReedSolomonReconstruct(split [][]byte, threshold, total int) (data []byte, err error)
- func ShamirCombine(keyshares [][]byte) (key []byte, err error)
- func ShamirSplit(key []byte, threshold, shares int) (keyshares [][]byte, err error)
Constants ¶
This section is empty.
Variables ¶
var ErrKeySize = fmt.Errorf("key is not %d bytes long", ed25519PrivateSeedSize)
ErrKeySize indicates that the byte array used as entropy source is not 32 bytes long
Functions ¶
func Decrypt ¶
Decrypt authenticates and decrypts a message that was encrypted with ChaCha20Poly1305.
func RandomKey ¶
func RandomKey() (key []byte)
RandomKey reads randomness to generate a 32 byte key and panics if something went wrong.
func ReedSolomonEncode ¶
ReedSolomonEncode splits and encodes data into $total shards, out of which $threshold are needed for reconstruction.
func ReedSolomonReconstruct ¶
ReedSolomonReconstruct does
func ShamirCombine ¶
ShamirCombine reconstructs a 32 byte key from previously split keyshares. There is a minimum threshold required to recover the correct secret, however no error is emitted if you do not supply enough shares. You will simply receive a corrupted / wrong key.
Types ¶
This section is empty.