Cubehash
Bernstein's SHA-3 candidate: an ARX permutation with tunable rounds and block size
Experimental or unclassified. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About Cubehash
Cubehash is a cryptographic hash function. It produces a 28–64-byte output. It takes the parameter out_len (default 32). Its registry entry cites CubeHash16/32 (SHA-3 round 2/3 candidate), sphlib implementation. NextSSL lists it in the research tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
CubeHash is a hash function by Daniel J. Bernstein submitted to the NIST SHA-3 competition. It is defined by two tunable parameters, rounds per block r and bytes per block b, written CubeHashr/b, and reached the second round.
CubeHash keeps a 1024-bit state of 32 32-bit words and absorbs b bytes of message at a time, applying r rounds of a fixed ARX permutation after each block, in a sponge-like fashion. Each round adds, rotates, swaps and XORs halves of the state. After the final block, a flag is set and the state is mixed through extra rounds before output. Smaller b and larger r give more security at the cost of speed.
The second-round proposal was CubeHash16/32. NextSSL includes the sphlib CubeHash16/32 implementation and a set of parameter variants wired from benchmarking sources: 8/1, 8/2, 8/4, 8/8, 8/16, 8/32, 16/1, 16/2, 16/4, 16/8 and 16/16. The variant ids encode r and b directly, for example cubehash832 is CubeHash8/32. Lower r values make the hash faster and weaker.
History
2007–2015NIST announces a public competition for a new hash standard, SHA-3
NIST SHA-3 competitionCubeHash published by Daniel J. Bernstein
64 designs submitted; 51 accepted into round 1
NIST SHA-3 competition14 designs advance to round 2
NIST SHA-3 competitionFive finalists named: BLAKE, Grøstl, JH, Keccak and Skein
NIST SHA-3 competitionKeccak selected as SHA-3
NIST SHA-3 competitionSHA-3 published as FIPS 202
NIST SHA-3 competition
Security notes
No practical attacks on the proposed CubeHash16/32 parameters are known, but its preimage resistance was criticised as weaker than NIST's requirements for 512-bit outputs, and it was not chosen as a finalist. The parameter variants are unverified and some offer reduced security margins.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 28 – 64 | Output |
Parameters
| Name | Type | Range | Default | Required |
|---|---|---|---|---|
| out_len | u64 | 28 – 64 | 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
root = NextSSL(root=True) # tier 'research' is reachable from the root API only
digest = root.call("hash_with", "cubehash", None, b"abc")[0]
nextssl_root_hash_with("cubehash", NULL, data, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let digest = reg::hash_in(reg::all(), Policy::Any, "cubehash", &Params::new(), b"abc")?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Similar names
Looking for something else?More hash functions
All 424Frequently asked questions
What is Cubehash?
Cubehash is a hash in the CubeHash family. CubeHash is a hash function by Daniel J. Bernstein submitted to the NIST SHA-3 competition.
What are the Cubehash sizes?
In NextSSL, Cubehash uses: output 28 to 64 bytes.
Who designed Cubehash and when?
Cubehash belongs to the CubeHash family, first published in 2008 by Daniel J. Bernstein. Its origin: NIST SHA-3 competition (round 2).
Which standards define Cubehash?
Cubehash is referenced by CubeHash16/32 (SHA-3 round 2/3 candidate), sphlib implementation.
Is Cubehash safe to use?
Cubehash is in the research tier. Experimental or unclassified. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
Related families
ARX stream cipher with a one-time Poly1305 MAC; fast and constant-time in software
SHA-3 and KeccakThe Keccak sponge, standardised by NIST in FIPS 202 as a structural alternative to SHA-2
ChaChaBernstein's ARX stream cipher; ChaCha20 secures much of today's TLS, SSH and VPN traffic
Salsa20Bernstein's eSTREAM-portfolio ARX stream cipher and the core of scrypt and NaCl
SHA-3 and KeccakThe Keccak sponge, standardised by NIST in FIPS 202 as a structural alternative to SHA-2