# Fix \#24999: copy left-overs before we XOR into c\. \(\#25001\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/37f4bee92a78fa4543d723b834a1570e2dd38a13)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 37f4bee92a78fa4543d723b834a1570e2dd38a13

Requested commit: 37f4bee92a78fa4543d723b834a1570e2dd38a13

Commit: 37f4bee92a78fa4543d723b834a1570e2dd38a13

Tree: 29694e59a8077b441b153d295997a37ddc4b0968

Author: Erik Schlyter

Committer: GitHub

## Message

```
Fix #24999: copy left-overs before we XOR into c. (#25001)

It is important we copy the left-overs in the message *before* we XOR
it into the ciphertext, because if we're encrypting in-place (i.e., m ==
c), we will manipulate the message that will be used for tag generation.
This will generate faulty tags when message length doesn't conform with
16 byte blocks.
```

## Parents

- [9924897c065af526f43c82d4b8328b5e72d100bd](https://git.cafe/gitcafe/zig/commit/9924897c065af526f43c82d4b8328b5e72d100bd?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/37f4bee92a78fa4543d723b834a1570e2dd38a13?format=markdown)
