Back to search

University of Adelaide

Enhancing State-of-the-Art Techniques Generating Low-Level Code for Cryptographic Arithmetic

Abstract

dc:description.abstract

Fast cryptography is a crucial enabler for modern communication over the Internet. It provides authenticity, confidentiality, integrity, and non-repudiation in the vast majority of web traffic to date. Its ubiquitous deployment makes correctness and high speed of paramount importance. The status quo for achieving high speed in cryptography is that implementations are written manually in assembly languages and hand-optimised by domain experts. While achieving high speeds, this process is tedious and error-prone. Prior work has shown how those hand-written implementations can be formally verified, and other work has shown how to optimise existing implementations. However, both approaches require significant manual effort. This thesis presents CryptOpt, an optimising code generator that uses Genetic Improvement to automatically generate those high-speed assembly implementations. While doing so, the emitted code preserves enough structure to enable mechanised correctness validation. CryptOpt uses a random local search heuristic. It starts by implementing the target function correctly. It then randomly mutates this implementation to generate a different implementation that is semantically equivalent. CryptOpt then runs both implementations on the target hardware and keeps the more performant one. By repeating those steps iteratively, the performance of the code is gradually improved. The main benefit of this technique is that the microarchitecture can be treated as an opaque unit, as opposed to the need for manual microarchitecture modelling in other approaches. CryptOpt seamlessly integrates into Fiat Cryptography, a framework that follows a correct-by-construction approach for the automatic generation of cryptographic code. Before this thesis, Fiat Cryptography bottomed out at higher-level languages like C or Rust. Now, the formal correctness guarantees are extended to the assembly level. The resulting optimised implementations are up to 2.96 times faster than what off-the-shelf compilers produce. For Curve25519 (part of the TLS standard) and the Bitcoin elliptic curve, the newly generated code is as fast as hand-written implementations on average, and can outperform on latest microarchitectures. The CryptOpt-generated code for Curve25519 is integrated into BoringSSL, the cryptographic library that powers Google Chrome and Microsoft Edge.

Degree

thesis:*
College dc:contributor.school
School of Computer and Mathematical Sciences
Year dc:date.issued
2023

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Kuepper, Joel
Advisors dc:contributor.advisor
  • Yarom, Yuval
  • Wagner , Markus (Monash University)
  • Chuengsatiansup, Chitchanok (University of Melbourne)

Subjects

dc:subject × 5

Rights

Language dc:language.iso
en

Identifiers

dc:identifier.*
Handle dc:identifier.uri
https://hdl.handle.net/2440/144161

Chain of custody

source
Harvested from
University of Adelaide
Base URL
digital.library.adelaide.edu.au/server/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
citation

Kuepper, Joel. Enhancing State-of-the-Art Techniques Generating Low-Level Code for Cryptographic Arithmetic. 2023. https://hdl.handle.net/2440/144161