Crates.io | blake2b_simd |
lib.rs | blake2b_simd |
version | 1.0.2 |
source | src |
created_at | 2018-08-12 07:17:52.808085 |
updated_at | 2023-09-10 19:34:41.265643 |
description | a pure Rust BLAKE2b implementation with dynamic SIMD |
homepage | |
repository | https://github.com/oconnor663/blake2_simd |
max_upload_size | |
id | 79071 |
size | 145,498 |
An implementation of the BLAKE2b and BLAKE2bp hash functions. See also
blake2s_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 blake2b_simd::{blake2b, Params};
let expected = "ca002330e69d3e6b84a46a56a6533fd79d51d97a3bb7cad6c2ff43b354185d6d\
c1e723fb3db4ae0737e120378424c714bb982d9dc5bbd7a0ab318240ddd18f8d";
let hash = blake2b(b"foo");
assert_eq!(expected, &hash.to_hex());
let hash = Params::new()
.hash_length(16)
.key(b"The Magic Words are Squeamish Ossifrage")
.personal(b"L. P. Waterhouse")
.to_state()
.update(b"foo")
.update(b"bar")
.update(b"baz")
.finalize();
assert_eq!("ee8ff4e9be887297cf79348dc35dab56", &hash.to_hex());