strobe-rs
This is a relatively barebones, no_std
implementation of the Strobe protocol framework in pure Rust. It is intended to be used as a library to build other protocols and frameworks. This implementation currently only supports Keccak-f[1600] as the internal permutation function, which is the largest possible block size, so big deal.
Example
A simple program that encrypts and decrypts a message:
use ;
Features
Default features flags: [none]
Feature flag list:
std
- Implementsstd::error::Error
forAuthError
.serialize_secret_state
- Implementsserde
'sSerialize
andDeserialize
traits for theStrobe
struct. SECURITY NOTE: Serializing Strobe state outputs security sensitive data that MUST be kept private. Treat the data as you would a private encryption/decryption key.
For info on how to omit or include feature flags, see the cargo docs on features.
MSRV
The current minimum supported Rust version (MSRV) is 1.51.0 (2021-03-25).
Tests
To run tests, execute
cargo test --all-features
This includes known-answer tests, which test against JSON-encoded test vectors in the kat/ directory. To verify these test vectors against the reference Python implementation, cd
into kat/
, run python2 verify_test_vector.py
and follow the included instructions.
Benchmarks
To benchmark, run
cargo bench
This will produce a summary with plots in target/crieteron/report/index.html
. These won't be very interesting, since almost every function in STROBE has the same runtime.
TODO
- Contribute an asm impelmentation of Keccak-f[1600] to tiny-keccak and expose a feature flag that lets
strobe-rs
users choose which implementation they prefer.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Warning
This code has not been audited in any sense of the word. Use at your own discretion.