Cryptonite : Scalable Accelerator Design for Cryptographic Primitives and Algorithms

Karthikeya Sharma Maheswaran ‡ , Camille Bossut † , Andy Wanna ‡ , Qirun Zhang † , Cong Hao ‡ · 2025

Read Cryptonite : Scalable Accelerator Design for Cryptographic Primitives and Algorithms by Karthikeya Sharma Maheswaran ‡ , Camille Bossut † , Andy Wanna ‡ , Qirun Zhang † , Cong Hao ‡ (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-2505-14657.txt.

Introduction

Karthikeya Sharma Maheswaran and co-authors present a tool that builds hardware accelerators for cryptography, in a 2025 paper. Cryptographic routines repeat the same steps on unlike inputs and are usually written as straight-line C code for processors. Dedicated hardware is needed where resources and delay are tight, but turning that code into hardware by standard synthesis gives bulky, slow designs.

Their tool, Cryptonite, first rewrites the code with verified rules to expose hardware structures that reuse resources. It then explores delay-focused versions of the compact design automatically. Designers can scale an accelerator to fit a resource budget. On routines from a verified elliptic curve library, designs used up to about eighty-nine percent less resource and ran about half again faster than naive synthesis. The tool aims at secure communication hardware.

Catalog record

CREATORKarthikeya Sharma Maheswaran ‡ , Camille Bossut † , Andy Wanna ‡ , Qirun Zhang † , Cong Hao ‡
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE43 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2505-14657

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Cryptonite : Scalable Accelerator Design for Cryptographic Primitives and Algorithms Karthikeya Sharma Maheswaran ‡ , Camille Bossut † , Andy Wanna ‡ , Qirun Zhang † , Cong Hao ‡ Abstract Cryptographic primitives, consisting of repetitive operations with different inputs, are typically implemented using straight-line C code due to traditional execution on CPUs. Computing these primitives is necessary for secure communication; thus, dedicated hardware accelerators are required in resource and latency-constrained environments. High-Level Synthesis (HLS) generates hardware from high-level implementations in languages like C, enabling the rapid prototyping and evaluation of designs, leading to its prominent use in developing dedicated hardware accelerators. However, directly synthesizing the straight-line C implementations of cryptographic primitives can lead to large hardware designs with excessive resource usage or suboptimal performance. We introduce Cryptonite, a tool that automatically generates efficient, synthesizable, and correct-by-design hardware accelerators for cryptographic primitives directly from straight-line C code. Cryptonite first identifies high-level hardware constructs through verified rewriting, emphasizing resource reuse. The second stage automatically explores latency-oriented implementations of the compact design. This enables the flexible scaling of a particular accelerator to meet the hardware requirements. We demonstrate Cryptonite’s effectiveness using implementations from the Fiat Cryptography project, a library of verified and auto-generated cryptographic primitives for elliptic-curve cryptography. Our results show that Cryptonite achieves scalable designs with up to 88.88% reduced resource usage and a 54.31% improvement in latency compared to naively synthesized designs. I Introduction Modern day computer security heavily relies on cryptography for authentication, encryption, and key exchange protocols. The implementation of cryptographic primitives, the foundational building blocks of cryptographic protocols, must be both correct and efficient to safeguard security and privacy. Improving the efficiency of computing such primitives is imperative, as it directly impacts the performance and scalability of security systems. Hardware acceleration has become a widely adopted methodology to meet this need, alleviating computational bottlenecks, enabling real-time processing, and reducing the risk of system vulnerabilities. Ongoing efforts have prioritized manually accelerating cryptographic algorithms such as Number Theoretic Transforms (NTT) [ 1 ] and Polynomial Multiplications [ 2 ] , with an emphasis on creating efficient data-flow architectures [ 3 ] . Implementing such architectures is challenging, time-consuming, and requires expert knowledge. Therefore, there is a need to bridge the gap by automating the generation of such architectures. Cryptographic primitives, usually written in C [ 4 ] , contain repetitive computations to encrypt, decrypt, or sign using a particular scheme [ 5 ] with different inputs, making them ideal candidates for hardware acceleration. Being written in C with no high-level constructs, they can easily be synthesized using High-Level Synthesis (HLS). These straight-line codes lack branch statements, loops, and array constructs, leading to low-latency execution with excessive resource usage. While resource constraints can be applied using pragmas such as #pragma HLS allocation , this usually results in complex control logic and bad timing [ 6 , 7 ] . Therefore, cryptographic primitives need to be rewritten for synthesis by HLS to generate high-performing, resource-efficient accelerators. Cryptographic primitives are often deployed in resource-constrained environments [ 8 , 9 ] , making it essential for synthesized designs to be scalable . This scalability enables the exploration of trade-offs between resource usage and latency. Real-world applications demand parallel execution of multiple primitives and co-optimization across them. Tuning the performance of each primitive is essential to achieve overall resource efficiency and performance optimization. For a given C program, the Vitis HLS compiler emits a single design. This design changes with different code structures, even if they are functionally equivalent. Exploring the resource-latency trade-off of cryptographic accelerators directly generated by HLS is challenging, as the straight-line C programs have no explicitly parameterizable constructs. Despite this, repeated patterns in straight-line C-code can be rolled into loop constructs, enabling design space exploration (DSE). This work tackles this challenge with automated, verified source-code rewriting, enabling architectural DSE. Users then choose from the Pareto-optimal designs to best meet hardware requirements. We target straight-line C programs from the Fiat Cryptography project [ 10 ] , a library of verified and auto-generated cryptographic primitives for elliptic-curve cryptography. Using two implementation baselines, one with the original straight-line code from the Fiat Project and the other with loop constructs, we reduced resource utilization and comparable latency to the baselines. This work, Cryptonite, has three main contributions: • Verified source-to-source HLS transformations, generating array and loop constructs from straight-line code using equivalence graphs (e-graphs). • Automatic Design Space Exploration over looped code, resulting in a range of previously unattainable points with varying resource-latency profiles. • Exploring the co-optimization of multiple primitives with parallel execution for scalable accelerator design. The rest of the paper is organized as follows. Section II frames and motivates this work. Section III provides an overview of the Cryptonite 1 1 1 This tool has been open-sourced at https://github.com/KarthikeyaSharma16/Cryptonite tool. Section IV presents our experimental results, and Section V summarizes and addresses related work. Finally, Section VI concludes the paper. II Motivation Fig. 1 : Cryptonite workflow. The advent of hardware accelerators has optimized compute-intensive tasks such as Machine Learning (ML) algorithms by leveraging structured code with high data reuse, minimal dependencies, and predictable memory access patterns, enabling efficient parallelization based on workload demands. Cryptographic primitives, on the other hand, have different memory access patterns from ML code that are also more irregular. These are often straight-line programs that prioritize runtime efficiency rather than decipherable code structure. Fig. 1 illustrates an example of a straight-line program (❶) with a dependency structure. Note that the displayed code is a simplified version of the original code. In this code, no clear patterns emerge, and redundant computations are repeated across different code segments. The non-trivial data dependencies due to complex arithmetic, irregular array access patterns, and the absence of loops result in an inefficient algorithm-to-hardware mapping. For instance, if a straight-line code contains 100 independent assignment operations involving at least one 128-bit multiplication, DSP resources are statically allocated for every multiplication. This results in poor resource reuse and limits scalability for larger cryptographic workloads. To quantify the inefficiencies on hardware utilization and scalability, we evaluate the performance of this workload using a metric called Normalized Performance Index (NPI) , which is defined in Eq. 1 : \mathit{NPI}=w_{1}\frac{\mathit{l}-\mathit{l}_{\min}}{\mathit{l}_{\max}-\mathit{l}_{\min}}+w_{2}\frac{\mathit{r}-\mathit{r}_{\min}}{\mathit{r}_{\max}-\mathit{r}_{\min}}\vskip 10.34958pt (1) Where l is the latency of a design and r is the percentage of resources used. In this section, the NPI is computed with w_{1}=w_{2}=0.5. A lower NPI metric indicates a more optimal balance between resource utilization and latency. The percentage of resources used r is determined with Eq. 2 : \mathit{r}=\frac{1}{4}\left(\frac{\mathit{DSP}_{\mathit{u}}}{\mathit{DSP}_{\mathit{t}}}+\frac{\mathit{LUT}_{\mathit{u}}}{\mathit{LUT}_{\mathit{t}}}+\frac{\mathit{FF}_{\mathit{u}}}{\mathit{FF}_{\mathit{t}}}+\frac{\mathit{BRAM}_{\mathit{u}}}{\mathit{BRAM}_{\mathit{t}}}\right)\times 100 (2) Table I summarizes the results obtained after testing two cryptographic kernels across multiple configurations, starting with the baseline code. Amongst all the tested cases, the baseline kernels exhibit the highest NPI values, indicating suboptimal performance. A naive approach to maximizing resource usage through built-in pragma ( #pragma HLS allocation ) led to poor hardware mapping and increased design latency, underscoring the need for a more sophisticated solution. Testing the baseline code with state-of-the-art (SOTA) DSE tools for HLS, such as ScaleHLS, showed negligible improvement over the baseline, highlighting the challenges of optimizing straight-line cryptographic workloads. Introducing loop structures into the baseline code improved hardware mapping, but at the cost of higher

Read the complete text