Rust Verification with SAW
This tutorial introduces SAW’s Rust/MIR verification capabilities. After completing this tutorial, you will be able to:
Use
saw-rustcandcargo-saw-buildto extract SAW-ready MIR from RustUse SAW’s MIR capabilities to verify code that utilizes references and compound data types (i.e.
structs andenums)Write proofs compositionally, even when the subtleties of mutable references are involved
Verify code that utilizes static items
Additionally, you will step through the process of verifying an implementation of the Salsa20 stream cipher against a Cryptol reference specification, showing how SAW’s MIR capabilities may be used on a more realistic codebase.
You can download the tutorial files.
Contents
- Introduction
- Prerequisites
- About
mir-json - SAW basics
- Reference types
- Compound data types
- Overrides and compositional verification
- Static items
- Case study: Salsa20
- The
salsa20crate - Salsa20 preliminaries
- A note about cryptographic security
- An overview of the
salsa20code - Building
salsa20 - Getting started with SAW
- Verifying our first
salsa20function - Verifying the
roundsfunction - Verifying the
counter_setupfunction - Verifying the
apply_keystreamfunction (first attempt) - Verifying the
new_rawfunction - Verifying the
apply_keystreamfunction (second attempt)
- The
- A final word