Verified Low-Level Programming Embedded in F*

Jonathan Protzenko, Jean-Karim Zinzindohoué, Aseem Rastogi, Tahina Ramananandro, Peng Wang +6 more
2/28/2017
cs.PLcs.CR

Official code: FStarLang/karamel (522 stars, Apache-2.0, last commit 2026-10-20).

Abstract

We present Low*, a language for low-level programming and verification, and its application to high-assurance optimized cryptographic libraries. Low* is a shallow embedding of a small, sequential, well-behaved subset of C in F*, a dependently-typed variant of ML aimed at program verification. Departing from ML, Low* does not involve any garbage collection or implicit heap allocation; instead, it has a structured memory model à la CompCert, and it provides the control required for writing efficient low-level security-critical code. By virtue of typing, any Low* program is memory safe. In addition, the programmer can make full use of the verification power of F* to write high-level specifications and verify the functional correctness of Low* code using a combination of SMT automation and sophisticated manual proofs. At extraction time, specifications and proofs are erased, and the remaining code enjoys a predictable translation to C. We prove that this translation preserves semantics and side-channel resistance. We provide a new compiler back-end from Low* to C and, to evaluate our approach, we implement and verify various cryptographic algorithms, constructions, and tools for a total of about 28,000 lines of code, specification and proof. We show that our Low* code delivers performance competitive with existing (unverified) C cryptographic libraries, suggesting our approach may be applicable to larger-scale low-level software.

View on arXivView PDF

Code Implementations(1)

FStarLang/karamelOfficial100%
Apache-2.0

KaRaMeL is a tool for extracting low-level F* programs to readable C code

52274C, F*May 27, 2016yesterdayApache-2.0
c-languagecryptographyf-starproofsverification

Similar Papers

Cite this paper

@article{protzenko2017verified,
  title  = {Verified Low-Level Programming Embedded in F*},
  author = {Jonathan Protzenko and Jean-Karim Zinzindohoué and Aseem Rastogi and Tahina Ramananandro and Peng Wang and Santiago Zanella-Béguelin and Antoine Delignat-Lavaud and Catalin Hritcu and Karthikeyan Bhargavan and Cédric Fournet and Nikhil Swamy},
  year   = {2017},
  eprint = {1703.00053},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1703.00053}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1703.00053.svg)](https://codeofpaper.com/paper/1703.00053)

Discussion