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