MCPcopy Create free account
hub / github.com/Mister-leo/fssh / DecryptAEAD

Function DecryptAEAD

internal/crypt/crypt.go:43–57  ·  view source on GitHub ↗
(key []byte, nonce []byte, ciphertext []byte, aad []byte)

Source from the content-addressed store, hash-verified

41}
42
43func DecryptAEAD(key []byte, nonce []byte, ciphertext []byte, aad []byte) ([]byte, error) {
44 blk, err := aes.NewCipher(key)
45 if err != nil {
46 return nil, err
47 }
48 aead, err := cipher.NewGCM(blk)
49 if err != nil {
50 return nil, err
51 }
52 pt, err := aead.Open(nil, nonce, ciphertext, aad)
53 if err != nil {
54 return nil, err
55 }
56 return pt, nil
57}
58
59func RandBytes(r io.Reader, n int) ([]byte, error) {
60 b := make([]byte, n)

Callers 2

unlockSeedMethod · 0.92
LoadDecryptedRecordFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected