maskNonce XORs the given nonce with the mask and stores the result in dst.
(dst, nonce, mask []byte)
| 103 | |
| 104 | // maskNonce XORs the given nonce with the mask and stores the result in dst. |
| 105 | func maskNonce(dst, nonce, mask []byte) { |
| 106 | nonce1 := binary.LittleEndian.Uint64(nonce[:sizeUint64]) |
| 107 | nonce2 := binary.LittleEndian.Uint32(nonce[sizeUint64:]) |
| 108 | mask1 := binary.LittleEndian.Uint64(mask[:sizeUint64]) |
| 109 | mask2 := binary.LittleEndian.Uint32(mask[sizeUint64:]) |
| 110 | binary.LittleEndian.PutUint64(dst[:sizeUint64], nonce1^mask1) |
| 111 | binary.LittleEndian.PutUint32(dst[sizeUint64:], nonce2^mask2) |
| 112 | } |
| 113 | |
| 114 | // NonceSize returns the required nonce size. |
| 115 | func (s *rekeyAEAD) NonceSize() int { |