Skip to content

std/crypto: add the AEGIS AEADs#6442

Merged
andrewrk merged 3 commits into
ziglang:masterfrom
jedisct1:aegis
Sep 29, 2020
Merged

std/crypto: add the AEGIS AEADs#6442
andrewrk merged 3 commits into
ziglang:masterfrom
jedisct1:aegis

Conversation

@jedisct1

Copy link
Copy Markdown
Contributor

Showcase that Zig can be a great option for high performance cryptography.

The AEGIS family of authenticated encryption algorithms was selected for high-performance applications in the final portfolio of the CAESAR competition.

They reuse the AES core function, but are substantially faster than the CCM, GCM and OCB modes while offering a high level of security.

AEGIS algorithms are especially fast on CPUs with built-in AES support, and the 128L variant fully takes advantage of the pipeline in modern Intel CPUs.

Performance of the Zig implementation is on par with libsodium.

@jedisct1

jedisct1 commented Sep 27, 2020

Copy link
Copy Markdown
Contributor Author

Benchmark result (with AESNI):

 chacha20Poly1305:        353 MiB/s
xchacha20Poly1305:        356 MiB/s
       gimli-aead:        132 MiB/s
        aegis128l:      16234 MiB/s
        aegis-256:       9653 MiB/s

@andrewrk

Copy link
Copy Markdown
Member

16234 MiB/s

that is a big number

@jedisct1

jedisct1 commented Sep 27, 2020

Copy link
Copy Markdown
Contributor Author

Without AES-NI, this remains faster than other options:

 chacha20Poly1305:        347 MiB/s
xchacha20Poly1305:        352 MiB/s
       gimli-aead:        131 MiB/s
        aegis128l:        679 MiB/s
        aegis-256:        455 MiB/s

@jedisct1 jedisct1 changed the title std/crypto: add the AEGIS128L AEAD std/crypto: add the AEGIS AEADs Sep 28, 2020
Showcase that Zig can be a great option for high performance cryptography.

The AEGIS family of authenticated encryption algorithms was selected for
high-performance applications in the final portfolio of the CAESAR
competition.

They reuse the AES core function, but are substantially faster than the
CCM, GCM and OCB modes while offering a high level of security.

AEGIS algorithms are especially fast on CPUs with built-in AES support, and
the 128L variant fully takes advantage of the pipeline in modern Intel CPUs.

Performance of the Zig implementation is on par with libsodium.
@andrewrk andrewrk merged commit a1ae3f9 into ziglang:master Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants