#aes #subspace #proof-of-replication #proof-of-time

rust-aes-proofs

Various AES-based Proof-of-Replication and Proof-of-Time implementations and benchmarks

2 unstable releases

0.2.0 May 24, 2020
0.1.0 May 17, 2020

#1467 in Cryptography

MIT license

190KB
3K SLoC

Rust AES Proofs

Various AES-based Proof-of-Replication and Proof-of-Time implementations and benchmarks.

Requirements and dependencies:

Source code is written in Rust, so first of all you need to have Rust toolchain installed, the best way is to follow instructions for your platform on rustup.rs.

System dependencies for OpenCL

Besides Rust compiler itself you'll need following components installed on your machine to run OpenCL-based implementation:

  • gcc
  • OpenCL drivers and development files for your GPU

On Ubuntu 18.04+ for AMD GPUs they can be installed like this:

sudo apt-get install gcc ocl-icd-opencl-dev mesa-opencl-icd

On Ubuntu 18.04+ for Intel GPU they can be installed like this:

sudo apt-get install gcc ocl-icd-opencl-dev beignet-opencl-icd

Software OpenCL implementation

It is also possible to use Oclgrind to run OpenCL implementation on CPU in software.

On Ubuntu 18.04+ Oclgrind can be installed like this:

sudo apt-get install oclgrind

Running tests abd benchmarks

TL;DR:

cargo test
cargo bench

For tests built-in Rust functionality is used, so this chapter of Rust book will help you.

Running only subset of tests can be achieved easily like this:

cargo test -- por::aes_ni # Only run Proof-of-Replication tests and only AES-NI implementation

Look at src/por and src/pot subdirectories for available implementations.

For benchmarks Criterion is used, so you can use its documentation.

Since benchmarks may take a long time to run, you may want to only run subset of them, which can be conveniently achieved like this:

cargo bench --bench por -- OpenCL # Only run Proof-of-Replication benchmarks and only OpenCL implementation

Look at benches subdirectory for available benchmarks and implementations.

Dependencies

~4.5MB
~84K SLoC