# std.crypto.onetimeauth.Ghash: make GHASH 2 \- 2.5x faster \(\#13374\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 0d192ee9ef6a69ca4841b1932579b9178938a6d5

Requested commit: 0d192ee9ef6a69ca4841b1932579b9178938a6d5

Commit: 0d192ee9ef6a69ca4841b1932579b9178938a6d5

Tree: f1050372fe82bfa47b0da196605167254c4c5d71

Author: Frank Denis

Committer: GitHub

## Message

```
std.crypto.onetimeauth.Ghash: make GHASH 2 - 2.5x faster (#13374)

Rewrite GHASH to use 128-bit multiplication over non-reversed
integers, and up to 8 blocks aggregated reduction.

lib/std/crypto/benchmark.zig results:

Xeon E5:
  Before: 1604 MiB/s
   After: 4005 MiB/s

Apple M1:
  Before: 2769 MiB/s
   After: 6014 MiB/s

This also makes AES-GCM faster by the way.
```

## Parents

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

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