# std.crypto.auth: add AEGIS MAC \(\#13607\) · gitcafe/zig

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

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

Visibility: public

Requested revision: ea05223b638789f2ef5b35081e66b5f4f5a45d77

Requested commit: ea05223b638789f2ef5b35081e66b5f4f5a45d77

Commit: ea05223b638789f2ef5b35081e66b5f4f5a45d77

Tree: da1ee4a9d48e6c102be51066e068b53eb26cd1fb

Author: Frank Denis

Committer: GitHub

## Message

```
std.crypto.auth: add AEGIS MAC (#13607)

* Update the AEGIS specification URL to the current draft

* std.crypto.auth: add AEGIS MAC

The Pelican-based authentication function of the AEGIS construction
can be used independently from authenticated encryption, as a faster
and more secure alternative to GHASH/POLYVAL/Poly1305.

We already expose GHASH, POLYVAL and Poly1305 for use outside AES-GCM
and ChaChaPoly, so there are no reasons not to expose the MAC from AEGIS
as well.

Like other 128-bit hash functions, finding a collision only requires
~2^64 attempts or inputs, which may still be acceptable for many
practical applications.

Benchmark (Apple M1):

    siphash128-1-3:       3222 MiB/s
             ghash:       8682 MiB/s
    aegis-128l mac:      12544 MiB/s

Benchmark (Zen 2):

    siphash128-1-3:       4732 MiB/s
             ghash:       5563 MiB/s
    aegis-128l mac:      19270 MiB/s

```

## Parents

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

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