(out, nonce, ciphertext, additionalData []byte)
| 490 | } |
| 491 | |
| 492 | func (f *xorNonceAEAD) Open(out, nonce, ciphertext, additionalData []byte) ([]byte, error) { |
| 493 | for i, b := range nonce { |
| 494 | f.nonceMask[4+i] ^= b |
| 495 | } |
| 496 | result, err := f.aead.Open(out, f.nonceMask[:], ciphertext, additionalData) |
| 497 | for i, b := range nonce { |
| 498 | f.nonceMask[4+i] ^= b |
| 499 | } |
| 500 | |
| 501 | return result, err |
| 502 | } |
| 503 | |
| 504 | func aeadAESGCM(key, noncePrefix []byte) aead { |
| 505 | if len(noncePrefix) != noncePrefixLength { |