See Seal and Open argument lists.
$ impl T cipher.AEAD
func (T) NonceSize() int {
panic("not implemented")
}
func (T) Overhead() int {
panic("not implemented")
}
func (T) Seal(dst []byte) []byte {
panic("not implemented")
}
func (T) Open(dst []byte) ([]byte, error) {
panic("not implemented")
}
$ godoc crypto/cipher AEAD
type AEAD interface {
// NonceSize returns the size of the nonce that must be passed to Seal
// and Open.
NonceSize() int
// Overhead returns the maximum difference between the lengths of a
// plaintext and ciphertext.
Overhead() int
// Seal encrypts and authenticates plaintext, authenticates the
// additional data and appends the result to dst, returning the updated
// slice. The nonce must be NonceSize() bytes long and unique for all
// time, for a given key.
//
// The plaintext and dst may alias exactly or not at all.
Seal(dst, nonce, plaintext, data []byte) []byte
// Open decrypts and authenticates ciphertext, authenticates the
// additional data and, if successful, appends the resulting plaintext
// to dst, returning the updated slice. The nonce must be NonceSize()
// bytes long and both it and the additional data must match the
// value passed to Seal.
//
// The ciphertext and dst may alias exactly or not at all.
Open(dst, nonce, ciphertext, data []byte) ([]byte, error)
}
AEAD is a cipher mode providing authenticated encryption with associated
data.
func NewGCM(cipher Block) (AEAD, error)
NewGCM returns the given 128-bit, block cipher wrapped in Galois Counter
Mode.