rust-aes-proofs

Crates.iorust-aes-proofs
lib.rsrust-aes-proofs
version0.2.0
sourcesrc
created_at2020-05-17 23:17:34.717413
updated_at2020-05-24 23:31:19.508872
descriptionVarious AES-based Proof-of-Replication and Proof-of-Time implementations and benchmarks
homepage
repositoryhttps://github.com/subspace/rust-aes-proofs
max_upload_size
id242825
size264,940
J Wagstaff (rg3l3dr)

documentation

https://docs.rs/rust-aes-proofs

README

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.

Commit count: 44

cargo fmt