arXiv:2611.01989cs.CRNov 2026

Manuscript Offprint

arXiv:2611.01989

Accelerating QUIC Encryption in WebAssembly Using WASM-SIMD

Sota Yamawaki, Yasuo Okabe

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

WebAssembly (Wasm) runs untrusted code in a portable, lightweight sandbox and is increasingly used to host services on shared servers and edge platforms. Running the QUIC transport protocol inside Wasm would let each application choose and update its own transport without changing the host. QUIC, however, encrypts every packet, and Wasm offers neither dedicated AES instructions nor carry-less multiplication; a Wasm QUIC stack has been reported to reach only 17.6% of native goodput, with cryptography as its largest cost. Whether the 128-bit SIMD extension of Wasm (WASM-SIMD) can recover this cost, and what limits a pure-Wasm stack once it does, has remained unclear. Here we show that explicit WASM-SIMD kernels recover much of the cryptographic cost, after which non-cryptographic costs become the limit. On two hosts connected by 10-Gigabit Ethernet, kernels that process eight AES blocks or four ChaCha20 blocks per pass raise receiver goodput over a non-SIMD baseline by 61.34% for AES-128-GCM and 31.55% for ChaCha20-Poly1305, whereas compiler auto-vectorization gains only 1.28% for AES-128-GCM. ChaCha20-Poly1305 still delivers 1.99 times the goodput of AES-128-GCM, confirming end to end the preference that stand-alone cipher benchmarks suggest. Receiver-side profiling combined with Amdahl's law predicts that even native-speed cryptography would leave Wasm at roughly one third of the goodput of the fastest native stack. Cryptographic acceleration is therefore necessary but not sufficient: memory allocation, runtime overhead and per-datagram UDP I/O now bound pure-Wasm transports. We anticipate that this per-category cost breakdown will guide further optimization of Wasm network stacks and the design of system interfaces for batched I/O.

Keywords WebAssembly · QUIC · WASM-SIMD · Authenticated encryption

1 Introduction

Running the entire QUIC transport [3, 4] inside WebAssembly (Wasm) lets each application on a shared server or edge platform replace and update its transport without modifying the host [5]. Wasm and the WebAssembly System Interface (WASI) offer such platforms language independence and lightweight sandboxing [1], and recent work composes QUIC stacks from isolated Wasm components [2].

This flexibility costs performance, mainly in cryptography, because Wasm lacks the instructions that make encryption cheap on native platforms. QUIC applies authenticated encryption to every packet. On native platforms, dedicated AES instructions keep this cost small: disabling packet protection improves performance by only 10–20% [6], and the throughput gap between QUIC and TCP on fast links stems mainly from packet processing rather than encryption [14]. Wasm, in contrast, prioritizes portability and lacks both dedicated AES and carry-less multiplication instructions [9]. Spies et al. [2] found that their fastest Wasm configuration reached only 17.6% of the goodput of the fastest native configuration, with cryptography as the largest contributor to the gap.

A Japanese version of this work has been submitted as a manuscript for presentation at the IEICE Technical Committee on Internet Architecture (IA). The abstract is available at https://ken.ieice.org/ken/paper/202611028cZo/eng/.

A PREPRINT

Without AES instructions, the usual preference for AES-GCM also becomes questionable. TLS 1.3 requires AES-128-GCM and recommends AES-256-GCM and ChaCha20-Poly1305 among its authenticated encryption with associated data (AEAD) algorithms [25], and QUIC uses the same cipher suites [7]. Which of AES-128-GCM and ChaCha20-Poly1305 is faster depends on whether the platform provides AES instructions [8], so the native ranking cannot be assumed in Wasm.

Delegating cryptography to the host would sidestep the problem but undermine the reason for a Wasm transport. A host interface such as WASI-Crypto [18], or TLS termination by the host, ties the transport to features that every platform must provide, moves key material across the sandbox boundary, and, for QUIC, requires a guest-host call per packet. A pure-Wasm stack avoids these dependencies but must make cryptography fast with the instructions that Wasm offers.

Existing work leaves two questions open: whether WASM-SIMD, the 128-bit single-instruction-multiple-data extension of Wasm, can recover a substantial part of the cryptographic cost, and what limits a pure-Wasm QUIC stack once it does. The first is unsettled because the Wasm build of BoringSSL used by Spies et al. was a generic implementation with assembly disabled, and stand-alone benchmarks of Wasm ciphers [19] do not show how cipher speed translates into the goodput and CPU time of a complete QUIC transfer. The second requires attributing CPU time to processing categories, not only measuring throughput.

We answer both questions with explicit WASM-SIMD kernels in a pure-Wasm QUIC stack that targets WASI 0.3, evaluated on two hosts connected by 10-Gigabit Ethernet (10GbE). The underlying techniques, bitsliced [15] and fixsliced [17] AES and vectorized ChaCha20 [16], are known; we adapt them to WASM-SIMD and quantify their end-to-end effect on QUIC. Our contributions are threefold:

  1. Cryptographic kernels tailored to WASM-SIMD. An eight-block fixsliced AES kernel and a four-block ChaCha20 kernel with shuffle-based rotations raise goodput over the non-SIMD baseline by 61.34% with AES-128-GCM and 31.55% with ChaCha20-Poly1305. Auto-vectorization alone gains only 1.28% with AES-128-GCM.

  2. An end-to-end comparison of ciphers in pure Wasm. ChaCha20-Poly1305 delivers 2.44 times the goodput of AES-128-GCM without SIMD and 1.99 times with our kernels. This turns the preference suggested by stand-alone benchmarks [19] into an end-to-end measurement.

  3. A quantification of the costs that remain. A per-category breakdown of receiver CPU time and Amdahl's law show that even native-level cryptography would leave Wasm at about one third of the fastest native goodput. Memory allocation, runtime overhead, and per-datagram socket I/O emerge as the next targets.

Scope. We study the receiving side of a bulk transfer over a single, lossless QUIC connection between two x86-64 hosts, with Wasmtime as the runtime and AES-128-GCM and ChaCha20-Poly1305 as the AEADs. We do not evaluate Wasm senders, AES-256-GCM, short connections, lossy or high-latency paths, or other runtimes and instruction sets; Section 9 discusses what our conclusions do and do not cover.

Sections 2 and 3 give background and related work. Sections 4 and 5 describe our stack, the evaluated configurations, and the methodology. Section 6 profiles the baseline, Section 7 presents the kernels, and Section 8 evaluates them. Section 9 discusses limitations, and Section 10 concludes.