1
0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-09-21 08:11:36 +02:00
official implementations of the BLAKE3 cryptographic hash function https://github.com/BLAKE3-team/BLAKE3
Go to file
2020-01-04 04:33:55 -05:00
.github/workflows test release mode in CI 2019-12-13 13:15:48 -05:00
b3sum make derive_key take a key of any length 2019-12-28 17:56:29 -06:00
benches rename 1_chunk benchmarks to 1_kib 2019-12-13 10:06:46 -05:00
media kaby lake graph, readme edit 2019-12-05 22:01:28 +01:00
reference_impl make derive_key take a key of any length 2019-12-28 17:56:29 -06:00
src add the guts module to share code with Bao 2019-12-29 11:55:19 -06:00
test_vectors make derive_key take a key of any length 2019-12-28 17:56:29 -06:00
.gitignore
build.rs make the "c_avx512" feature a no-op on non-x86 2019-12-12 15:13:04 -05:00
Cargo.toml make the "c_avx512" feature a no-op on non-x86 2019-12-12 15:13:04 -05:00
CONTRIBUTING.md readme draft and benchmark 2019-12-04 18:57:05 +01:00
LICENSE add a LICENSE file including CC0 and Apache 2.0 2019-12-15 17:44:01 -05:00
README.md merge fix 2020-01-04 04:33:55 -05:00

BLAKE3

BLAKE3 is a cryptographic hash function that is

  1. Faster than MD5, SHA1, SHA2, SHA3, and even BLAKE2
  2. Highly parallelizable: The more data and the more cores, the faster it goes. (For you specialists reading this: this is because it is actually a MerkleTree under the hood.)
  3. Capable of streaming and random-access verification. (Again: the magic of Merkle Trees.)
  4. Carefully engineered to be simple and safe to use, with no "modes" or tweaks required.

The complete specifications and design rationale are available as a PDF and its LaTeX source.

This repository provides the reference implementation of BLAKE3, which is coded in Rust and includes portable as well as optimized code for various instructions sets.

The b3sum sub-crate provides a command line interface. SSE4.1 and AVX2 implementations are provided in Rust, enabled by default, with dynamic CPU feature detection. AVX-512 and NEON implementation are available via C FFI, controlled by the c_avx512 and c_neon features. Rayon-based multi-threading is controlled by the rayon feature.

Eventually docs will be published on docs.rs. For now, you can build and view the docs locally with cargo doc --open.

The following graph shows BLAKE3's multi-threaded throughput on an Intel Kany Lake processor:

benchmarks

BLAKE3 was designed by:

WARNING: BLAKE3 is not a password-hash function, because it's designed to be fast, whereas password hashing should not be fast. If you hash passwords to store the hashes or if you derive keys from password, we recommend Argon2.

Usage

TODO

History

BLAKE3 is essentially an adapted version of BLAKE2 using the tree Bao tree mode.

BLAKE2 is an established cryptographic hash function, for example supported by OpenSSL, and used in countless applications. Bao is a tree hashing mode satisfying the requirements for provably secure tree hashing.

Contributing

Please see CONTRIBUTING.md

Licensing

The source code in the present repository is dual-licensed under Apache 2 and CC0 licences.