arrow-left

Only this pageAll pages
gitbookPowered by GitBook
1 of 14

SAW

Loading...

DOCUMENTATION

Loading...

Loading...

Crux

Loading...

Loading...

Loading...

OPEN SOURCE

Loading...

Loading...

Download

Loading...

Loading...

What is Crux?

Crux is a tool for improving the assurance of software using symbolic testing, currently supporting C/C++ and Rust. Crux can provide you with additional assurance that your code does what you want it to do, and provides higher coverage of possible inputs than techniques such as randomized fuzzing or unit testing.

Specifically, Crux uses symbolic reasoning to check tests exhaustively, on all possible inputs, rather than on a smaller number of fixed or randomly-chosen values. In this way, Crux improves the coverage possible with property-based testingarrow-up-right, a popular approach supported by librariesarrow-up-right forarrow-up-right manyarrow-up-right languagesarrow-up-right.

Crux can:

  • Perform symbolic reasoning to evaluate tests exhaustively

  • Analyze C/C++ and Rust code

  • Generate counter-examples when tests fail

  • Generate executable versions of counter-examples to load in a debugger

  • Generate complete models of programs to comprehensively rule out failure cases

Crux is available open-source under the 3-Clause BSD License .

on GitHubarrow-up-right

When should I use Crux?

Crux tends to work well with small, critical segments of code that primarily perform computation, rather than interacting with the outside world. For example, it is well-suited to code such as cryptographic algorithms, network packet serialization, signal processing, and similar domains. When using Crux to ensure the absence of specific bugs, the code being analyzed should operate only over fixed-size data structures, and include only loops that will terminate after a bounded number of iterations, regardless of the contents of input data. However, Crux can still be useful for finding bugs in programs that operate over unbounded data or use unbounded loops.

For larger programs, or programs where certain portions of code are missing, the allows additional user input to divide programs into components and reason about those components more efficiently by considering them independently.

Software Analysis Workbench (SAW)arrow-up-right

Overview

SAW is an open source project, hosted on GitHub, licensed under the 3-clause BSD license. We believe that anyone who uses SAW is making an important contribution toward making the tool better. There are many ways to get involved.

hashtag
Explore the Github Repositoryarrow-up-right

SAW: The Software Analysis Workbench

hashtag
What is SAW?

The Software Analysis Workbench (SAW) is a tool that provides the ability to formally verify properties of code written in C, Java, Rust, and . It leverages automated SAT and SMT solvers to make this process as automated as possible, and provides a scripting language, called SAWScript, to enable verification to scale up to more complex systems. We also provide a remote procedure call (RPC) API and offer a Python libraryarrow-up-right that interfaces with the RPC API.

View on GitHubarrow-up-right Download

hashtag
Core Features and Capabilities

  • Comprehensive Assurance: As a formal verification tool, SAW is capable of showing that your program works on all inputs, not just the ones it was tested on, and is capable of finding counterexamples when code doesn’t agree with its specification.

  • Scalable Security: and SAW automate much of the most time-consuming parts of formal verification, enabling the process to scale to complex systems.

  • Open Source Library: You can access the code for SAW in our repository.

hashtag
How Does it Work?

Behind the scenes, SAW leverages symbolic execution to translate code into formal models. During this process it executes code on symbolic inputs, effectively unrolling loops, and translating the code into a circuit representation. Symbolic execution is well suited to verifying code with bounded loops such as cryptographic verification.

SAW is closely connected with , a domain-specific language Galois created for the high-level specification of cryptographic algorithms. The most common use of SAW is to prove equivalence between a Cryptol specification of an algorithm and a production implementation written in a language such as C or Java.

hashtag
Impact

At Galois, we have used SAW primarily to verify implementations of cryptographic algorithms such as the , the , and . We have used this to verify existing widely used libraries such as and .

We also have used SAW in collaboration with Amazon to prove the correctness of the HMAC implementation in their implementation of the TLS protocol. You can read more about that work .

More broadly, Cryptol and SAW have been used in national security, fintech, and cloud computing applications to keep citizens, systems, and data safe; secure financial transactions; and protect the privacy of millions of people across the globe. The high assurance approach they represent forms the backbone—both technologically and philosophically—of Galois’s larger effort to create trustworthiness in the most critical systems on the planet, and to maximize impact through sharing these powerful tools with the open source community.

hashtag
Open Source

The R&D community, industry, and the public at large can benefit when tools like SAW are open sourced. In addition, open-source tools can themselves benefit from and be independently verified by a broad, diverse user community. With this in mind, Galois has developed SAW as an open source tool from the very beginning, and the tool is open for anyone to use and explore.

open source arrow-up-right
READ OUR DOCUMENTATION
AES block cipherarrow-up-right
Secure Hash Algorithm (SHA)arrow-up-right
Elliptic Curve Digital Signature Algorithm (ECDSA)arrow-up-right
libgcryptarrow-up-right
Bouncy Castlearrow-up-right
s2narrow-up-right
herearrow-up-right
SAW SCRIPT REPOarrow-up-right

How to Contribute

SAW is in active development. At Galois, we are passionate about improving the security and safety of critical software, and we think that verification tools such as SAW have an important role in achieving that goal.

We would love feedback on how to make SAW better. Please contact us at [email protected] if you have any questions about SAW or high assurance development in general. If you encounter any issues using SAW, please file a .

ticket on GitHubarrow-up-right

Publications

  • "Constructing semantic models of programs with the software analysis workbencharrow-up-right" by Robert Dockins, Adam Foltzer, Joe Hendrix, Brian Huffman, Dylan McNamee, and Aaron Tomb

  • “Verified Cryptographic Code for Everybodyarrow-up-right” by Brett Boston, Samuel Breese, Joey Dodds, Mike Dodds, Brian Huffman, Adam Petcher, and Andrei Stefanescu

  • “Continuous Formal Verification of Amazon s2narrow-up-right” by Andrey Chudnov, Nathan Collins, Byron Cook, Joey Dodds, Brian Huffman, Colm MacCárthaigh, Stephen Magill, Eric Mertens, Eric Mullen, Serdar Tasiran, Aaron Tomb, and Eddy Westbrook

Public Key

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBGKCqukBEAC5L3c5MYpH3GL/DHI57mazcvh1INQUWlIn+yWdIitVDq/Epj6h
eQYMh5kdoVzy8nZIYLCOLTjgP3MBaY+Y3UmpmMCdhMSKpPXx5RMKN0y9+N9Uh6RQ
2bu6VjYqnm4LnLRJ8bGw+Ve56ysQMhzYpLan3j2Vcne+X1qaDPVhZJGmAdQztCLo
paGp75Rtq1sO0fxBZ7hnh2aTXSS4DE25AsVQjnpQXGS3l/pxK6dNQIY9uB153bCd
Uxrkod0wLICObo1WZvSAc690jeBSvspLPxfgri8p7ZxwQ9Z/X4tDxchDUcAZIYR4
Iz0JsIi2OSBLZIYD9wrsw/GvSPXHPi7n4gJz5K5lR9mCzcSOdavI3Kiqt1JaLljy
I+Q10AZPowyL2JymYRxa8R/ACV8pDCBhp64jBOyS7AtUXBbwoPQ72ppNUTP/OgSI
JH+YanKnwA7mFyS7XUtyyfadJ+scer6Opg5ATcIoRJ5vWMi9gIe5waNfM3PJPSq1
me8cFHB3tiajSm1HqonMaZIbQdphiIVDCPlUXflmWdfjOctsUo4m8x9izRJqNk8M
0KPQGRQCA1+3l4XXTz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n9EFYtuOf
qqS0itP+MtwEqS74zQ+leDrP6nPSr8wLpYVUo/R8pTv/0Q8nvM/nDShDjv6Etmkp
XOZZ7ZJOO57exT6W2fpZt12T3N19lblKRC0YuJpWaw8RhAvAcXx7BgcEPRb9JVWk
6XvyJ+Tl3pgL6RXUSTIglRci6QnVOh7gIGb9m9LGqadOlSjcUmpcPcyGq0jsm6oJ
nHdsF+ebaqB+LqapEv+TmN9b4CXVP2DoMSYfD+FffESaM99IapjyrsrfIpN2Gz7M
Mlt7hiEt0V5OX88e8yGVSEVShQrJf0IJmK8T7ZFr0TuvrvRt67mIxY55sgarwuAG
fivwqr2HwvnbXI1+nlXWQhDWykKQIw4QWEO0PsOPfULLB+eEog==
=dmYY
-----END PGP PUBLIC KEY BLOCK-----
Cryptol
Cryptol
Cryptol

SAW Tutorials and Manual

SAW's tutorials and user manual are built and deployed to GitHub Pages as part of saw-script's continuous integration system.

We deploy versions for the master branch and all release/version tags (such that you can easily reference the documentation for the version(s) of SAW that you use).

circle-exclamation

Version-specific Web documentation will be available for SAW versions ≥ 1.3. For older versions, please see the releasesarrow-up-right, which include PDF renderings of the tutorials and manual for those versions.

Visit to view all available Web versions of the documentation.

https://galoisinc.github.io/saw-scriptarrow-up-right

Get SAW

hashtag
Download a Binary

  • Linux (Ubuntu 22.04)arrow-up-right (GPG Signaturearrow-up-right)

  • ()

  • ()

  • ()

  • ()

SAW binaries for Linux and macOS are available from the GitHub . Binaries are distributed as .tar.gz or .zip files which you can extract to a location of your choice.

Nightly builds are also available .

GPG signatures are available for each release, and we encourage you to against our before installing to ensure the integrity of the release you downloaded.

SAW is also available for and can be fetched using one of the following commands (for the REPL and RPC API, respectively):

Nightly versions of the Docker images are also available:

hashtag
Dependencies

SAW can make use of a variety of external tools, particularly SMT solvers. Due to SAW’s use of , the Z3 solver is a strict dependency for Cryptol type checking.

The full set of SMT solvers we currently support for other verification tasks is determined by Levent Erkök’s package and Galois’ package. This set currently includes ABC, Boolector, CVC4, CVC5, MathSAT, Yices, and Z3. These solvers can be downloaded from their respective developers at the locations below.

  • from UC Berkeley

  • from Johannes Kepler University Linz

  • from New York University

As of release v1.1, we also provide binary packages for SAW that include compatible versions of a variety of solvers. Look for archive files that have with-solvers in the filename on the .

from Stanford University and the University of Iowa
  • from Fondazione Bruno Kessler

  • from SRI International

  • from Microsoft Research

  • Linux (Ubuntu 24.04)arrow-up-right
    GPG Signaturearrow-up-right
    macOS 15 (X64)arrow-up-right
    GPG Signaturearrow-up-right
    macOS 15 (ARM64)arrow-up-right
    GPG Signaturearrow-up-right
    Windowsarrow-up-right
    GPG Signaturearrow-up-right
    releases pagearrow-up-right
    herearrow-up-right
    check the signaturearrow-up-right
    public key
    Dockerarrow-up-right
    SBVarrow-up-right
    What4arrow-up-right
    ABCarrow-up-right
    Boolectorarrow-up-right
    CVC4arrow-up-right
    v1.5 release pagearrow-up-right
    Cryptol
    docker pull ghcr.io/galoisinc/saw:1.5
    docker pull ghcr.io/galoisinc/saw-remote-api:1.5
    docker pull ghcr.io/galoisinc/saw:nightly
    docker pull ghcr.io/galoisinc/saw-remote-api:nightly
    CVC5arrow-up-right
    MathSATarrow-up-right
    Yicesarrow-up-right
    Z3arrow-up-right

    Download Crux

    • Crux-LLVM (Ubuntu 22.04 64-bit)arrow-up-right (GPG Signaturearrow-up-right)

    • Crux-LLVM (Ubuntu 24.04 64-bit)arrow-up-right (GPG Signaturearrow-up-right)

    • Crux-LLVM (OSX Arm)arrow-up-right (GPG Signaturearrow-up-right)

    • ()

    • ()

    • ()

    • ()

    Crux binaries for Linux, macOS, and Windows are available from the GitHub . Binaries are distributed as tarballs which you can extract to a location of your choice. Note that Crux-MIR binaries for Windows are not currently included, but we expect to include them in an upcoming release.

    GPG signatures are available for each release, and we encourage you to against our before installing to ensure the integrity of the release you downloaded.

    Crux is also packaged using Docker, and can be fetched using one of the following commands:

    Use the following command to run crux-mir through cargo crux-test from Docker on the Cargo project in the current directory:

    hashtag
    Dependencies

    Crux requires a companion tool, mir-json, which provides a Cargo plugin and rustc wrapper. We recommend installing mir-json directly with Cargo by following the instructions in the .

    Crux can make use of a variety of external SMT solvers, including Boolector, CVC4, CVC5, Yices, and Z3. These solvers can be downloaded from their respective developers at the locations below.

    • from Johannes Kepler University Linz

    • from New York University

    • from Stanford University and the University of Iowa

    from SRI International
  • from Microsoft Research

  • Crux-LLVM (Windows 64-bit)arrow-up-right
    GPG Signaturearrow-up-right
    Crux-MIR (Ubuntu 22.04 64-bit)arrow-up-right
    GPG Signaturearrow-up-right
    Crux-MIR (Ubuntu 24.04 64-bit)arrow-up-right
    GPG Signaturearrow-up-right
    Crux-MIR (OSX Arm)arrow-up-right
    GPG Signaturearrow-up-right
    releases pagearrow-up-right
    check the signaturearrow-up-right
    public keyarrow-up-right
    mir-json READMEarrow-up-right
    Boolectorarrow-up-right
    CVC4arrow-up-right
    CVC5arrow-up-right
    docker pull ghcr.io/galoisinc/crux-llvm:0.12
    docker pull ghcr.io/galoisinc/crux-mir:0.12
    docker run --rm -it --mount type=bind,source=$(pwd),target="/crux-mir/workspace" ghcr.io/galoisinc/crux-mir:0.12
    Yicesarrow-up-right
    Z3arrow-up-right