# Make Poly1305 faster by leveraging @addWithOverflow/@subWithOverflow \(\#15815\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 9d179a98f69dbab393cbb3fc5dd4b64c553a721b

Requested commit: 9d179a98f69dbab393cbb3fc5dd4b64c553a721b

Commit: 9d179a98f69dbab393cbb3fc5dd4b64c553a721b

Tree: 87ed4994d77e60cc82c3cc241710a861abd14edc

Author: Frank Denis

Committer: GitHub

## Message

```
Make Poly1305 faster by leveraging @addWithOverflow/@subWithOverflow (#15815)

These operations are constant-time on most, if not all currently
supported architectures. However, even if they are not, this is not
a big deal in the case on Poly1305, as the key is added at the end.

The final addition remains protected.

SalsaPoly and ChaChaPoly do encrypt-then-mac, so side channels would
not leak anything about the plaintext anyway.

* Apple Silicon (M1)

Before: 2048 MiB/s
After : 2823 MiB/s

* AMD Ryzen 7

Before: 3165 MiB/s
After : 4774 MiB/s
```

## Parents

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

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