Cipher: AES-256 in Counter and Galois/Counter Modes

August 4, 2026 · View on GitHub

This directory holds the encryption kernels behind sz_aes256_ctr_xor, sz_aes256_gcm_encrypt, sz_aes256_gcm_decrypt, and the streaming sz_aes256_gcm_encryptor and sz_aes256_gcm_decryptor families. Each operation has a serial baseline plus per-ISA SIMD backends — westmere and icelake on x86, neonaes and sve2aes on Arm, rvvcrypto on RISC-V, powervsx on Power, and v128 with v128relaxed on WebAssembly. The dispatcher picks the fastest one available on the running CPU.

Methodology

Cells are throughput in GB/s, measured with bench/cipher.cpp on one core pinned away from the scheduler, reporting the median of nine calibrated samples and reproducible to about one and a half percent. Each row is the library compiled with that single backend forced on one fixed chip, and each column is one message size, so coverage and cross-chip comparison read down a single column. The Serial row is the reference; there is no Standard row here, since no standard library ships a block cipher. Message size decides how much of a call is key schedule and tag arithmetic rather than bulk work, so results sweep four sizes from a short record to a page-sized buffer. A cell is genuinely-missing data, on a backend not yet measured on hardware that runs it.

Counter Mode

Backend256 B1 KB4 KB16 KB
Serial @ Xeon40.04 GB/s0.04 GB/s0.04 GB/s0.04 GB/s
Westmere @ Xeon44.49 GB/s5.88 GB/s6.18 GB/s6.51 GB/s
Ice Lake @ Xeon48.18 GB/s12.2 GB/s14.6 GB/s14.8 GB/s
NEON @ Graviton4
SVE2 @ Graviton4

Measured August 4th, 2026.

Galois/Counter Mode

Backend256 B1 KB4 KB16 KB
Serial @ Xeon40.004 GB/s0.004 GB/s0.004 GB/s0.004 GB/s
Westmere @ Xeon42.43 GB/s3.20 GB/s3.24 GB/s3.22 GB/s
Ice Lake @ Xeon43.42 GB/s6.37 GB/s7.59 GB/s8.31 GB/s
NEON @ Graviton4
SVE2 @ Graviton4

Measured August 4th, 2026.