Module blake2b_simd::blake2bp

source ·
Expand description

An implementation of BLAKE2bp, a variant of BLAKE2b that takes advantage of the parallelism of modern processors.

The AVX2 implementation of BLAKE2bp is about twice as fast that of BLAKE2b, because it’s able to use AVX2’s vector operations more efficiently. However, note that it’s a different hash function, and it gives a different hash from BLAKE2b for the same input.

Example

use blake2b_simd::blake2bp;

let hash = blake2bp::Params::new()
    .hash_length(16)
    .key(b"The Magic Words are Squeamish Ossifrage")
    .to_state()
    .update(b"foo")
    .update(b"bar")
    .update(b"baz")
    .finalize();
assert_eq!("e69c7d2c42a5ac14948772231c68c552", &hash.to_hex());

Structs

A parameter builder for BLAKE2bp, just like the Params type for BLAKE2b.
An incremental hasher for BLAKE2bp, just like the State type for BLAKE2b.

Functions

Compute the BLAKE2bp hash of a slice of bytes, using default parameters.