MAC family

BLAKE2

A fast, secure successor to BLAKE with built-in keying, salting and tree hashing

standard 2 variants RFC 7693

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–2015
  1. BLAKE2 released

  2. BLAKE2b and BLAKE2s specified in RFC 7693

  3. Argon2 adopts BLAKE2b internally

How it works

  1. Initialise the state from IV XOR the parameter block
  2. Optionally process the key as a first padded block
  3. Compress each block with 12 (b) or 10 (s) rounds of the G function
  4. 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

General-purpose fast hashingKeyed MAC without HMACKey derivation inside Argon2Protocols such as WireGuard

Variants in NextSSL

2
AlgorithmTierSizes (bytes)StandardsAPI
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.