Microarchitecture Design and Benchmarking of Custom SHA-3 Instruction for RISC-V
2025
Read Microarchitecture Design and Benchmarking of Custom SHA-3 Instruction for RISC-V (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-20653.txt.
Introduction
Bolat and co-authors build a custom chip command that runs the SHA-3 hash shuffle in hardware, in this 2025 paper. Hashing guards data everywhere, yet SHA-3's tangled design resisted the built-in speedups that older ciphers enjoy. Most fixes bolt on side units instead.
The team placed the shuffle inside a RISC-V core and weighed pipeline, storage, and cost trade-offs. Careful simulation and a test chip measured the payoff. Tuned SHA-3 software ran up to eight times faster, and raw Keccak loads up to forty-six times faster. Register and logic costs rose only a little. The study maps a practical route to fast hashing.
Catalog record
| YEAR | 2025 |
|---|---|
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 27 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2508-20653
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Microarchitecture Design and Benchmarking of Custom SHA-3 Instruction for RISC-V Abstract Integrating cryptographic accelerators into modern CPU architectures presents unique microarchitectural challenges, particularly when extending instruction sets with complex and multistage operations. Hardware-assisted cryptographic instructions, such as Intel’s AES-NI and ARM’s custom instructions for encryption workloads, have demonstrated substantial performance improvements. However, efficient SHA-3 acceleration remains an open problem due to its distinct permutation-based structure and memory access patterns. Existing solutions primarily rely on standalone coprocessors or software optimizations, often avoiding the complexities of direct microarchitectural integration. This study investigates the architectural challenges of embedding a SHA-3 permutation operation as a custom instruction within a general-purpose processor, focusing on pipelined simultaneous execution, storage utilization, and hardware cost. In this paper, we investigated and prototyped a SHA-3 custom instruction for the RISC-V CPU architecture. Using cycle-accurate GEM5 simulations and FPGA prototyping, our results demonstrate performance improvements of up to 8.02× for RISC-V optimized SHA-3 software workloads and up to 46.31× for Keccak-specific software workloads, with only a 15.09% increase in registers and a 11.51% increase in LUT utilization. These findings provide critical insights into the feasibility and impact of SHA-3 acceleration at the microarchitectural level, highlighting practical design considerations for future cryptographic instruction set extensions. I Introduction and Related Work SHA-3 (Secure Hash Algorithm 3), standardized by NIST, is a cryptographic hash function and known for its robust resistance to cryptographic attacks and its adaptability across diverse applications, including authentication, data integrity, and blockchain safety. Unlike previous SHA family members, SHA-3 is built on the Keccak permutation, which employs a sponge construction to absorb input and produce secure hash outputs efficiently. This design underpins SHA-3’s growing adoption in security-critical domains for the future. To accelerate cryptographic workloads, many modern CPU architectures, such as Intel x86 and ARM, have introduced dedicated instruction set extensions like AES-NI [ 1 ] and ARM Cryptographic Extensions [ 2 ] that significantly speed up algorithms such as AES and SHA-2. These hardware-assisted instructions have become standard in industry, demonstrating substantial gains in both performance and energy efficiency. However, despite SHA-3’s increasing adoption in security applications, its integration at the instruction set level remains largely unexplored. Unlike SHA-2, which benefits from well-established instruction-level acceleration, SHA-3 presents unique computational characteristics due to its permutation-based Keccak structure, which consists of extensive bitwise operations, nonlinear transformations, and complex memory access patterns. While numerous studies have explored SHA-3 acceleration via dedicated hardware implementations on ASICs [ 3 , 4 ] or FPGAs [ 5 , 6 ] . These approaches operate as dedicated accelerators rather than integrated or embedded within a general-purpose processor. The lack of systematic investigation into SHA-3’s microarchitectural integration and integration of dedicated instruction leaves an open research question: how can SHA-3 be efficiently executed as a dedicated instruction within a CPU pipeline, similar to existing industrial solutions like cryptographic instruction extensions proposed for AES and SHA-2? Prior research has examined alternative SHA-3 acceleration methods, including coprocessors [ 7 ] , SoC level integrations [ 8 ] , and modifications on existing standard vector instructions [ 9 ] , as well as optimizations tailored to general-purpose CPU execution pipelines improving compatibility of integration [ 10 ] to reduce communication overhead between CPU and accelerator [ 11 ] . Besides these, some studies have also explored the performance leverage potential of SHA-3 when they closely integrated existing SIMD and Vector instruction in the CPU [ 12 , 13 ] . However, studies haven’t comprehensively analyzed the feasibility, microarchitectural challenges, and trade-offs of embedding dedicated SHA-3 capable custom instruction directly within a CPU’s datapath. Also, key considerations such as pipeline integration, memory efficiency, and hardware resource utilization remain largely unexplored. In this work, we propose a novel instruction-level acceleration approach for SHA-3 by directly embedding custom SHA-3 (Keccak) capable instruction into a RISC-V processor. We design and implement a SHA-3-specific instruction, analyze its execution within the CPU pipeline, and evaluate its impact on performance and area overhead. Our contributions are as follows: • First microarchitectural study of SHA-3 instruction integration directly into CPU datapath: We analyze the feasibility and challenges of embedding SHA-3 as a dedicated instruction within a general-purpose processor. • Custom SHA-3 instruction design with cycle-accurate CPU analysis and hardware prototype: We design and implement a SHA-3-specific instruction within a RISC-V-based processor on GEM5 and validate on FPGA hardware. • Comprehensive performance evaluation: Using GEM5 simulations and FPGA prototype, we demonstrate significant speedups—up to 8.02× for RISC-V-optimized SHA-3 and 46.31× for Keccak workloads—with minimal hardware overhead (15.09% increase in flip-flops and 11.51% increase in LUT utilization). II SHA-3 Computational Structure and Keccak-f Permutation Acceleration Depending on its operation types, the SHA-3 algorithm consists of two primary components: • Data Processing • Keccak-f Permutation Data processing involves preparing the input message for cryptographic hashing and consists of the following steps: • Padding: A predefined bit sequence is appended to the input message to ensure it is compatible with block size requirements. • Message Splitting: The padded message is divided into fixed-sized blocks for sequential processing. • Absorbing Phase: Each block is sequentially incorporated into a structured internal state matrix, represented as a 5\times 5 grid of 64-bit words. These steps primarily involve data movement operations—memory accesses, buffer handling, and state updates—rather than computationally intensive arithmetic or logic operations. Since modern CPU architectures are already optimized for general-purpose data movement and memory operations, accelerating these steps at the instruction level provides limited performance gains. Keccak-f permutation , in contrast, constitutes the computational core of SHA-3. It is responsible for the cryptographic transformation of the state matrix and consists of 24 iterative rounds, each composed of the following five fundamental operations: • \theta (Theta) – Ensures diffusion by computing parity across column-wise slices of the existing state on calculation. • \rho (Rho) – Applies cyclic bitwise rotations to introduce non-linearity on state. • \pi (Pi) – Permutes state bits by rearranging word positions on matrix. • \chi (Chi) – Applies a non-linear Boolean function based on bitwise operations. • \iota (Iota) – Injects round-dependent constants to strengthen resistance against linear and differential cryptanalysis. These operations rely heavily on bitwise XORs, ANDs, shifts, and modular rotations, making them computationally expensive when executed sequentially as software on general-purpose CPUs. Unlike the data processing phase, which is primarily constrained by memory bandwidth and register usage, the Keccak-f permutation needs a significant instruction execution overhead due to its reliance on intensive arithmetic and logical calculations. II-A Keccak-f Permutation as Combinational Logic A key architectural property of the Keccak-f permutation is that it partially supports implementation as pure combinational logic. Since each round of Keccak consists of well-defined bitwise transformations and calculations, dedicated hardware implementations can leverage fully parallelized combinational circuits to compute multiple rounds concurrently, significantly reducing execution latency. This inherent parallelism contrasts sharply with sequential software execution on general-purpose CPUs, where each logical operation turns into multiple instruction cycles, causing high computational overhead. While dedicated or co-processor type accelerator designs can exploit this characteristic to achieve ultra-low latency hashing, modern CPUs lack dedicated hardware primitives for Keccak-f. Instead, they execute the permutation in a highly serialized behavior, requiring multiple instructions for each XOR, shift, and bitwise permutation. This inefficiency motivates the use of custom