BLAKE2
A fast, secure successor to BLAKE with built-in keying, salting and tree hashing
Overview
BLAKE2 is a hash function family that is faster than MD5 on modern CPUs while offering security comparable to SHA-3. It is specified in RFC 7693 and provides a native keyed mode, so it can act as a MAC without HMAC.
BLAKE2 descends from BLAKE, a SHA-3 finalist, and keeps its ChaCha-derived G function while reducing rounds (12 for BLAKE2b, 10 for BLAKE2s), simplifying padding and adding a parameter block. The parameter block carries the digest length, key length, salt, personalisation string and tree-hashing parameters, so different uses yield unrelated outputs by construction.
NextSSL provides BLAKE2b with 512-bit output for 64-bit platforms, BLAKE2s with up to 256-bit output for 32-bit and embedded platforms, and the parallel variants BLAKE2bp (4-way) and BLAKE2sp (8-way), which hash interleaved lanes and combine them with a root node. Keyed BLAKE2b and BLAKE2s are exposed as MACs. BLAKE2 is used in Argon2, WireGuard, libsodium's generic hash and many file-integrity tools.
History
2012–2015BLAKE2 released
BLAKE2b and BLAKE2s specified in RFC 7693
Argon2 adopts BLAKE2b internally
How it works
- Initialise the state from IV XOR the parameter block
- Optionally process the key as a first padded block
- Compress each block with 12 (b) or 10 (s) rounds of the G function
- Mark the final block with a flag and output the truncated state
Security notes
No practical attacks are known on full-round BLAKE2; published cryptanalysis reaches only reduced-round variants. Keyed BLAKE2 is a secure PRF and MAC as long as the key is secret and at least as long as the security level required.
Typical uses
Variants in NextSSL
2| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| BLAKE2b-MAC blake2b-mac |
standard | key 1–64 · tag 64 | RFC 7693 | safe |
| BLAKE2s-MAC blake2s-mac |
standard | key 1–32 · tag 32 | RFC 7693 | safe |
Frequently asked questions
Which BLAKE2 variants does NextSSL include?
NextSSL registers 2 BLAKE2 variants: blake2b-mac, blake2s-mac.
Families with similar names
Other message authentication codes
All 30Related
NIST SP 800-90A deterministic random bit generator built on HMAC
BLAKE (SHA-3 finalist)The original BLAKE hash, a SHA-3 finalist and ancestor of BLAKE2 and BLAKE3
BLAKE3A Merkle-tree hash over BLAKE2s rounds, designed for parallel speed and unlimited output
SHA-3 and KeccakThe Keccak sponge, standardised by NIST in FIPS 202 as a structural alternative to SHA-2
BLAKE3A Merkle-tree hash over BLAKE2s rounds, designed for parallel speed and unlimited output
HMACThe standard way to build a MAC from a cryptographic hash (RFC 2104, FIPS 198-1)