tiny-keccak
An implementation of the FIPS-202-defined SHA-3 and SHAKE functions.
The Keccak-f[1600]
permutation is fully unrolled; it's nearly as fast
as the Keccak team's optimized permutation.
Building
Usage
Add this to your Cargo.toml
:
[]
= "1.0"
and this to your crate root:
extern crate tiny_keccak;
Example
extern crate tiny_keccak;
use Keccak;
Benchmarks
Benchmarked with rust-crypto sha3 on:
MacBook Pro (Retina, 15-inch, Mid 2015)
2,5 GHz Intel Core i7
16 GB 1600 MHz DDR3
Intel Iris Pro 1536 MB
Benchmark code is available here
running 4 tests
test rust_crypto_sha3_256_input_32_bytes ... bench: 1,538 ns/iter (+/- 180) = 20 MB/s
test rust_crypto_sha3_256_input_4096_bytes ... bench: 47,135 ns/iter (+/- 8,707) = 86 MB/s
test tiny_keccak_sha3_256_input_32_bytes ... bench: 698 ns/iter (+/- 113) = 45 MB/s
test tiny_keccak_sha3_256_input_4096_bytes ... bench: 20,772 ns/iter (+/- 2,692) = 197 MB/s
Why tiny-keccak is twice faster? It's optimized with: