BLAKE2s
A fast, secure successor to BLAKE with built-in keying, salting and tree hashing
About BLAKE2s
BLAKE2s is one of 4 BLAKE2 variants in the NextSSL registry, a cryptographic hash function. It produces a 16–32-byte output. It takes the parameter out_len (default 32). Its registry entry cites RFC 7693. NextSSL lists it in the standard tier and exposes it through the safe API.
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
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 16 – 32 | Output |
Parameters
| Name | Type | Range | Default | Required |
|---|---|---|---|---|
| out_len | u64 | 16 – 32 | 32 | no |
Parameters are passed as a string, for example nextssl_mac("hmac", "hash=sha512", …). Omitted parameters take their declared default.
Use it
from nextssl_demo import NextSSL
ns = NextSSL() # safe API: safe and standard tiers
digest = ns.call("hash_with", "blake2s", None, b"abc")[0]
nextssl_hash_with("blake2s", NULL, data, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let digest = reg::hash_in(reg::all(), Policy::Safe, "blake2s", &Params::new(), b"abc")?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other BLAKE2 variants
3Similar names
Looking for something else?More hash functions
All 424Frequently asked questions
What is BLAKE2s?
BLAKE2s is a hash in the BLAKE2 family. BLAKE2 is a hash function family that is faster than MD5 on modern CPUs while offering security comparable to SHA-3.
What are the BLAKE2s sizes?
In NextSSL, BLAKE2s uses: output 16 to 32 bytes.
Who designed BLAKE2s and when?
BLAKE2s belongs to the BLAKE2 family, first published in 2012 by Jean-Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn, Christian Winnerlein. Its origin: RFC 7693.
Which standards define BLAKE2s?
BLAKE2s is referenced by RFC 7693.
Is BLAKE2s safe to use?
BLAKE2s is in the standard tier. Standardised and sound. Reachable from the safe API. It can be called from the safe API.
What other BLAKE2 variants are there?
NextSSL also registers blake2b-512, blake2bp, blake2sp in the BLAKE2 family.
Related families
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)