strobe-rs
This is a relatively barebones 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
- This crate does support
no_std. However, thestdfeature is enabled by default. - A
nightlyfeature is also supported and disabled by default. This currently just forwards tosubtle'snightlyfeature.
For info on how to omit or include feature flags, see the cargo docs on features.
Tests
To run tests, execute cargo test. 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 kat/verify_test_vector.py and follow the included instructions.
Benchmarks
Since benchmarks are still not stable, run cargo +nightly bench.
TODO
- Get code coverage information
- Contribute an asm impelmentation of Keccak-f[1600] to tiny-keccak and expose a feature flag that lets
strobe-rsusers choose which implementation they prefer. - Put more asserts in the code like the Python implementation does. Not sure if this is a great idea though
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.