Cryptocorrosion
Cryptographic algorithms in pure Rust.
The main interface to these crates is the RustCrypto traits.
All crates are no-std compatible.
Minimum Rust version: 1.31.
Supported algorithms
Cryptographic hashes
| Algo | Crate name | SIMD |
|---|---|---|
| Blake | blake-hash | [1] |
| Grøstl | groestl-aesni | |
| JH | jh-x86_64 | |
| Skein | skein-hash |
[1] SIMD is available for builds with target-cpu/target-feature configured, but runtime CPU detection is not yet supported.
Block ciphers
| Algo | Crate name | SIMD |
|---|---|---|
| Threefish | threefish-cipher |
Stream ciphers
| Algo | Crate name | SIMD |
|---|---|---|
| ChaCha | c2-chacha |
SIMD
Many of the crates in this project include optimized SIMD implementations, enabled by default on x86-64 by the "simd" feature. The fastest implementation available for your hardware will be automatically selected at runtime, except in no-std builds.
For other hardware platforms, e.g. ARM: an alternative, portable SIMD backend based on the packed_simd crate is available for recent nightly Rust; you can enable it as "packed_simd".
If you'd prefer to minimize usage of unsafe code: disable the "simd" feature
to switch to a generic implementation.
| feature | crate | no unsafe |
rust version | build time? | performance |
|---|---|---|---|---|---|
| simd (default) | ppv_lite86 | 1.27 | fast | fast | |
| (no simd) | ppv_null | fast | slow | ||
| packed_simd | packed_simd | recent nightly | slow | fast |
License
All crates licensed under either of
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.