func (a *AESGCMCipher) Decrypt(data []byte, key Key) ([]byte, error) {
	aesKey, ok := key.(*AESKey)
	if !ok {
		return nil, fmt.Errorf("key must be of type *AESKey, was %T", key)
	}

	gcm, err := newBlockCipher(aesKey, a.nonceSizeBytes)
	if err != nil {
		return nil, err
	}
	plain, err := gcm.Open(nil, data[:a.nonceSizeBytes], data[a.nonceSizeBytes:], nil)
	if err != nil {
		return nil, fmt.Errorf("failed to decrypt value: %v", err)
	}
	return plain, nil
}
// Decrypt decrypts the provided value using the specified key. The key must be of type *AESKey. The provided data must
// be of the form [nonce+ciphertext+tag]. Returns the bytes for the decrypted ciphertext (the input originally provided
// to Encrypt).
Decrypt decrypts the provided value using the specified key. The key must be of type *AESKey. The provided data must
be of the form [nonce+ciphertext+tag]. Returns the bytes for the decrypted ciphertext (the input originally provided
to Encrypt).
// Decrypt decrypts the provided value using the specified key . The key must be of type * AESKey . The provided data must // be of the form [ nonce + ciphertext + tag ] . Returns the bytes for the decrypted ciphertext ( the input originally provided // to Encrypt ) .
func (a *AESGCMCipher) Decrypt(data []byte, key Key) ([]byte, error) {
	aesKey, ok := key.(*AESKey)
	if !ok {
		return nil, fmt.Errorf("key must be of type *AESKey, was %T", key)
	}
	gcm, err := newBlockCipher(aesKey, a.nonceSizeBytes)
	if err != nil {
		return nil, err
	}
	plain, err := gcm.Open(nil, data[:a.nonceSizeBytes], data[a.nonceSizeBytes:], nil)
	if err != nil {
		return nil, fmt.Errorf("failed to decrypt value: %v", err)
	}
	return plain, nil
}
func ( a * AESGCMCipher ) Decrypt ( data [ ] byte , key Key ) ( [ ] byte , error ) { aesKey , ok := key . ( * AESKey ) if ! ok { return nil , fmt . Errorf ( " " , key ) } gcm , err := newBlockCipher ( aesKey , a . nonceSizeBytes ) if err != nil { return nil , err } plain , err := gcm . Open ( nil , data [ : a . nonceSizeBytes ] , data [ a . nonceSizeBytes : ] , nil ) if err != nil { return nil , fmt . Errorf ( " " , err ) } return plain , nil }
Decrypt decrypts the provided value using the specified key.
Decrypt decrypts the provided value using the specified key .