Repository navigation
Conversation
madanm3
force-pushed
the
chachapoly_avx512_fused
branch
from
October 14, 2026 12:19
acdf2cd to
a1e5a30
Compare
Interleave ChaCha20 and Poly1305 in one AVX-512 loop. ChaCha20 uses the vector integer pipes and Poly1305 uses IFMA, so the MAC overlaps the next chunk of keystream instead of a second pass. The provider uses this path for every non-TLS message when the CPU can run it. A TLS record uses the one-shot kernel, with the tag left in the RFC 7905 layout. A bad tag still fails quietly after the plaintext is wiped. A small-footprint build keeps TLS two-pass. The one-time Poly1305 key is wiped after use. A payload that would wrap the 32-bit block counter is rejected before any keystream is used. Tests compare the kernel, one-shot EVP, and TLS records with the two-pass oracle, including the park and MAC cutoffs and a non-zero TLS sequence number. Measured with openssl speed -evp chacha20-poly1305 on an EPYC 9655, fused against the same binary with AVX-512 IFMA cleared. Encrypt is about 1.9x at 16 bytes, 2.8x at 64 bytes, 2.1x at 256 and 512 bytes, and 1.5x to 1.9x from 1024 bytes up. Decrypt is about 2.0x at 16 bytes, 2.8x at 64 bytes, 2.1x at 256 and 512 bytes, and 1.7x to 1.9x from 1024 bytes up. Median of three interleaved runs, pinned to one core.
madanm3
force-pushed
the
chachapoly_avx512_fused
branch
from
October 14, 2026 12:39
a1e5a30 to
beb8d2f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Measured with openssl speed -evp chacha20-poly1305 on an EPYC 9655, fused against the same binary with AVX-512 IFMA cleared. Encrypt is about 1.9x at 16 bytes, 2.8x at 64 bytes, 2.1x at 256 and 512 bytes, and 1.5x to 1.9x from 1024 bytes up. Decrypt is about 2.0x at 16 bytes, 2.8x at 64 bytes, 2.1x at 256 and 512 bytes, and 1.7x to 1.9x from 1024 bytes up. Median of three interleaved runs, pinned to one core.
System: AMD EPYC 9655 (Turin) 96-Core (Zen 5), 2 sockets, AVX-512 IFMA, RHEL 9, GCC 11.5.0 (-march=native) Command: openssl speed -evp chacha20-poly1305 [-decrypt] [-bytes N] -seconds 3 Method: single core pinned (taskset -c 0), median of 3 interleaved runs. Baseline = master. Numbers are MB/s (bytes/s / 1_000_000).
Encrypt
Baseline (master):
chachapoly_avx512_fused:
Speedup over baseline:
Decrypt (-decrypt)
Baseline (master):
chachapoly_avx512_fused:
Speedup over baseline:
Checklist