Crates.io | blake2s_const |
lib.rs | blake2s_const |
version | 0.8.0 |
source | src |
created_at | 2024-07-05 05:32:57.055604 |
updated_at | 2024-07-05 11:58:47.980208 |
description | a pure Rust BLAKE2s implementation with dynamic SIMD |
homepage | |
repository | https://github.com/oconnor663/blake2_simd |
max_upload_size | |
id | 1292380 |
size | 147,402 |
An implementation of the BLAKE2s and BLAKE2sp hash functions. See also
blake2b_simd
.
This crate includes:
blake2-avx2
.
These are very fast. For benchmarks, see the Performance section of the
README.no_std
support. The std
Cargo feature is on by default, for CPU feature detection and
for implementing std::io::Write
.many
module.use blake2s_simd::{blake2s, Params};
let expected = "08d6cad88075de8f192db097573d0e829411cd91eb6ec65e8fc16c017edfdb74";
let hash = blake2s(b"foo");
assert_eq!(expected, &hash.to_hex());
let hash = Params::new()
.hash_length(16)
.key(b"Squeamish Ossifrage")
.personal(b"Shaftoe")
.to_state()
.update(b"foo")
.update(b"bar")
.update(b"baz")
.finalize();
assert_eq!("28325512782cbf5019424fa65da9a6c7", &hash.to_hex());