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

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

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

Visibility: public

Requested revision: a51e88c3b108acfa1ea1823ed31d78870e662fc0

Requested commit: a51e88c3b108acfa1ea1823ed31d78870e662fc0

Commit: a51e88c3b108acfa1ea1823ed31d78870e662fc0

Tree: 97dd05bdf197c76f495697f2cf6d553a5503d018

Author: Erik Schlyter

Committer: Alex Rønne Petersen

## 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

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

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