#blake2b #ref #u8 #msg #blake2b-builder

blake2b-ref

A no_std BLAKE2B implementation

5 unstable releases

0.3.1 Aug 10, 2022
0.3.0 Dec 8, 2020
0.2.1 Nov 11, 2020
0.2.0 Oct 15, 2020
0.1.0 Jan 20, 2020

#710 in Algorithms

Download history 2437/week @ 2025-03-10 2295/week @ 2025-03-17 1795/week @ 2025-03-24 1224/week @ 2025-03-31 1608/week @ 2025-04-07 1558/week @ 2025-04-14 2367/week @ 2025-04-21 1425/week @ 2025-04-28 1216/week @ 2025-05-05 1180/week @ 2025-05-12 1529/week @ 2025-05-19 1270/week @ 2025-05-26 1704/week @ 2025-06-02 3053/week @ 2025-06-09 2565/week @ 2025-06-16 3293/week @ 2025-06-23

10,634 downloads per month
Used in 47 crates (3 directly)

MIT license

1MB
21K SLoC

This crate is transcompiled from blake2b-ref

Example:

use blake2b_ref::Blake2bBuilder;

fn hash_message(msg: &[u8]) -> [u8; 32] {
    let mut output = [0u8; 32];
    let mut blake2b = Blake2bBuilder::new(32).personal(b"SMT").build();
    blake2b.update(msg);
    blake2b.finalize(&mut output);
    output
}

blake2b-ref.rs

Crates.io

A no_std BLAKE2B crate.

This crate is transcompiled by c2rust; the source code is from the offcial BLAKE2 ref implementation. The transcompiled source has been modified slightly to support no_std.

The API design is highly inspired - almost copy from https://github.com/nervosnetwork/blake2b-rs.

No runtime deps