Efficient Verification of Optimized Code: Correct High-speed X25519

Marc Schoolderman, Jonathan Moerman, Sjaak Smetsers, Marko van Eekelen
12/17/2020
cs.CRcs.LO

Official code: squell/verified-x25519-for-avr (3 stars, Assembly, last commit 2021-04-02).

Abstract

Code that is highly optimized poses a problem for program-level verification: programmers can employ various clever tricks that are non-trivial to reason about. For cryptography on low-power devices, it is nonetheless crucial that implementations be functionally correct, secure, and efficient.

Show full abstract

These are usually crafted in hand-optimized machine code that eschew conventional control flow as much as possible. We have formally verified such code: a library which implements elliptic curve cryptography on 8-bit AVR microcontrollers. The chosen implementation is the most efficient currently known for this microarchitecture. It consists of over 3000 lines of assembly instructions. Building on earlier work, we use the Why3 platform to model the code and prove verification conditions, using automated provers. We expect the approach to be re-usable and adaptable, and it allows for validation. Furthermore, an error in the original implementation was found and corrected, at the same time reducing its memory footprint. This shows that practical verification of cutting-edge code is not only possible, but can in fact add to its efficiency -- and is clearly necessary.

View on arXivView PDF

Code Implementations(1)

A verified, optimized implementation of X25519 for AVR microcontrollers

30Assembly, CMar 26, 20215 years agoNOASSERTION

Similar Papers

Cite this paper

@article{schoolderman2020efficient,
  title  = {Efficient Verification of Optimized Code: Correct High-speed X25519},
  author = {Marc Schoolderman and Jonathan Moerman and Sjaak Smetsers and Marko van Eekelen},
  year   = {2020},
  eprint = {2012.09919},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2012.09919}
}

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/2012.09919.svg)](https://codeofpaper.com/paper/2012.09919)

Discussion