import (
"crypto/cipher"
+ "crypto/internal/alias"
"crypto/subtle"
"errors"
"internal/byteorder"
}
ret, out := sliceForAppend(dst, len(plaintext)+g.tagSize)
+ if alias.InexactOverlap(out[:len(plaintext)], plaintext) {
+ panic("crypto/cipher: invalid buffer overlap")
+ }
var counter, tagMask [gcmBlockSize]byte
g.deriveCounter(&counter, nonce)
g.auth(expectedTag[:], ciphertext, data, &tagMask)
ret, out := sliceForAppend(dst, len(ciphertext))
+ if alias.InexactOverlap(out, ciphertext) {
+ panic("crypto/cipher: invalid buffer overlap")
+ }
if subtle.ConstantTimeCompare(expectedTag[:g.tagSize], tag) != 1 {
clear(out)