(dst, ciphertext []byte)
| 91 | } |
| 92 | |
| 93 | func (s *aes128gcm) Decrypt(dst, ciphertext []byte) ([]byte, error) { |
| 94 | seq, err := s.inCounter.Value() |
| 95 | if err != nil { |
| 96 | return nil, err |
| 97 | } |
| 98 | // If dst is equal to ciphertext[:0], ciphertext storage is reused. |
| 99 | plaintext, err := s.aead.Open(dst, seq, ciphertext, nil) |
| 100 | if err != nil { |
| 101 | return nil, ErrAuth |
| 102 | } |
| 103 | s.inCounter.Inc() |
| 104 | return plaintext, nil |
| 105 | } |