=====================================================
== Ariadne: A Minimal Approach to State Continuity ==
=====================================================

==| Proof |==

The proof is located in the "Proof/" folder. To verify the proof, install the Coq theorem prover:

 >  sudo apt-get install coq

(use used version 8.4pl4) and execute

 > cd Proof
 > make

Eventually Coq finishes with the text:

"Modules were successfully checked"

To check the model, especially the StateContinuity Theorem at line 3691 of ariadne.v will be of interest.

==| Implementation |==

The balanced Gray codes, Ariadne and tools to access and benchmark the TPM chip are located in the Implementation folder. Many tools rely on the Fides toolchain which can be downloaded and installed based on the instructions found at: https://distrinet.cs.kuleuven.be/software/pcbac/install.php

To compile all source code, execute:

 > cd <TheFidesToolchain>
 > . ./setup_environment 
 > cd <Ariadne>/Implementation
 > make

--| Balanced Gray Codes |--

The implementation of balanced Gray codes is available as a separate application in Implementation/Apps/BalancedGrayCodes. It does not rely on the Fides toolchain.

The "Precomputer" folder contains a small Haskell program that can be used to precompute the multiplicities and transition counts of varies balanced Gray codes. It will output a metedata.h file, as one was already created, this Precomputer tool does not need to be executed. For additional information we refer to Implementation/Apps/BalancedGrayCodes/README

The actual application outputs the requested balanced Gray codes:

 > /gray --n=10 --direction=FWD

--| Ariadne |--

While the Ariadne algorithm itself is quite simple, it's Fides/TPM implementation requires the use of a Theseus module and various callbacks to unprotected memory (e.g., to read a package). The implementation of a virtual monotonic counter can be found in chioneCounter and chioneCounter_n which uses the TPM directly and uses the Theseus module respectively. Supporting libraries can be found in Implementation/Libs 

Code is available to use a hardware and software TPM chip. Implementation/ReadMe discusses how these TPMs can be initialized and accessed.

