ZK/SEC Research notes from zkSecurity
All posts
announcement · cryptography

Nine Years to Halve a Hash Function: RFC 9861 Is Out

RFC 9861

Mid-2016, the Keccak team came back with a new algorithm called KangarooTwelve. And you might have guessed, it is to SHA-3 what BLAKE2 is to BLAKE.

KangarooTwelve (2017)

After nearly a decade in the making, RFC 9861: KangarooTwelve and TurboSHAKE was officially published in October 2025. zkSecurity was among its co-authors, working alongside Benoît Viguier, the Keccak team (Joan Daemen and Gilles Van Assche), and Quynh Dang from NIST. We're glad it's finally out, because the functions it defines deserve to be far more widely used than they are today.

Here's the short version: if you're reaching for SHA-3 or SHAKE, there's now a stable, citable specification for a family of hash functions that do the same job at the same security level, roughly twice as fast.

If you've used BLAKE2, this is the same idea. BLAKE2 took a finalist that the SHA-3 competition had already scrutinized to death, trimmed the round count, and ended up in Argon2, libsodium, and the Noise framework. KangarooTwelve does the same thing to the winner.

Halving the rounds

TurboSHAKE and KangarooTwelve are built on the exact same Keccak-p[1600] permutation as SHA-3 and SHAKE, but with 12 rounds instead of 24. That's a striking thing to do, and there are few precedents for it. Imagine cutting AES-128 from 10 rounds to 5, or halving the number of steps in SHA-256, or using a 128-bit curve in place of Curve25519. In most designs, that kind of reduction would gut the security margin.

So why is it fine here? Because few primitives have been attacked as much as Keccak. Since its introduction, it has accumulated more third-party cryptanalysis papers than any of its peers, and the results are reassuring: the best known collision attack reaches only 6 rounds.1 Twelve rounds is twice what anyone has managed to break, which is a comfortable margin by any standard. TurboSHAKE128 and TurboSHAKE256 inherit exactly the security claims of SHAKE128 and SHAKE256 (128-bit and 256-bit respectively); they just get there with half the work.

Too much crypto

Jean-Philippe Aumasson has been making the general version of this argument for years. His 2019 paper Too Much Crypto argues that round counts get picked conservatively at design time and then never revisited, no matter what cryptanalysis does or doesn't achieve. He refreshed it just this month, and it goes further than the RFC does: it makes the case for a 10-round SHA-3, which he calls KitTen in a nod to KangarooTwelve, for a 2.4x speed-up.

There's also a longer-standing complaint here, which is that SHA-3 was over-parameterized to begin with. Here's how I put it back in 2017:

This is because SHA-3's parameters are weirdly big. It is hard to know exactly why. The NIST provided some vague explanations. Other reasons might include: [...] Not to be less secure than SHA-2. SHA-2 had 256-bit security against pre-image attacks so SHA-3 had to provide the same [...] To give some credits to the NIST. In view of people's concerns with NIST's ties with the NSA, they could not afford to act lightly around security parameters.

KangarooTwelve (2017)

The complaint covered both knobs: the capacity, where SHA3-256 spends 512 bits to buy security nobody was asking for,2 and the round count. Both were set so that the standard would look unimpeachable in 2015, not because any attack demanded it. TurboSHAKE and KT fix the rounds the way SHAKE fixed the capacity.

What's actually in the RFC

RFC 9861 defines four functions:

  • TurboSHAKE128 and TurboSHAKE256, extendable-output functions (XOFs), meaning you can squeeze out as many output bytes as you want. These are the base primitives: SHAKE with the round count halved.
  • KT128 and KT256, the two security levels of KangarooTwelve, which layers a Sakura-compatible tree-hashing mode on top of TurboSHAKE. By splitting the input into chunks that can be hashed independently, KangarooTwelve exploits the parallelism in modern CPUs (SIMD) and hardware to go even faster on longer messages.

A few properties that matter, especially if you work in cryptography-heavy settings like we do:

  • No length-extension weakness. Unlike SHA-256 and SHA-512, these functions don't need an HMAC wrapper to be used safely as a MAC. The RFC does specify a MAC construction called HopMAC, which hashes the message with a keyless call and only brings in the key at the very end.4 The key therefore flows through a single permutation call regardless of message length.
  • A low-degree round function. The Keccak round function has algebraic degree 2, which makes masking against side-channel attacks more tractable than with SHA-2.
  • Customization strings. KT128/KT256 accept a customization string for clean domain separation, similar to the cSHAKE family.
  • Natural KDF use. With sufficient input min-entropy, these functions work directly as key-derivation functions, handy for turning a Diffie-Hellman or ECDH shared secret into keys.

Blazing fast

Halving the rounds roughly doubles throughput for TurboSHAKE over SHAKE. KangarooTwelve then adds parallelism on top, which widens the gap further on long messages. The Keccak team's benchmarks are worth a look: on an Intel SkylakeX, KT128 hashes at 6.29 GB/s while SHA-256 does 0.51 GB/s. On an Apple M1, where SHA-256 has a dedicated hardware instruction and is genuinely fast at 2.43 GB/s, KT128 still nearly doubles it at 4.25 GB/s.

Two caveats though:

  1. The parallelism speedup is workload-dependent. For short messages, KangarooTwelve falls back to a single TurboSHAKE call. That's still faster than SHAKE, but you won't see the tree-hashing gains, which only kick in on larger inputs and only when the implementation actually uses SIMD. If throughput on big messages is your bottleneck, this is a big win; if you're hashing tiny values, the win is the round reduction alone. The benchmarks show the effect: on the Cortex-A72, KT128 (0.367 GB/s) actually lands a hair below plain TurboSHAKE128 (0.373 GB/s).

  2. This is an IRTF/CFRG Informational RFC, not a NIST FIPS standard. For most applications that distinction doesn't matter: the specification is stable, peer-reviewed, and comes from the people who designed Keccak itself. But if you operate under FIPS compliance requirements, SHA-3/SHAKE remain the approved choices, and you can't swap in KT128 to satisfy a certification.

Cheap to compute, cheap to prove

The round count shows up in a second place, one we spend a lot of time in: proof systems. Hashing is often one of the heaviest workloads in a deployed SNARK, from Merkle openings to hash-based signature aggregation. Recent work has made that a lot cheaper. Flock proves 30k Keccak permutations per second on a single core of an M4 Max, within 250x of native execution.3 Since circuits unroll the rounds, the cost is close to linear in the round count, so 12 rounds instead of 24 is quite literally half the constraints. The case for TurboSHAKE in circuits becomes even stronger.

Golfing the permutation

Keccak-f[1600] is also one of the challenges on zk.golf, our platform for fearless, formally verified circuit optimization. The task is to build the cheapest circuit that applies the 24-round permutation to a 1600-bit state, together with a Lean proof that it still matches the FIPS 202 specification. The baseline, taken from the de-facto reference pure-R1CS Circom implementation, costs 307,200 in allocations plus constraints, and the leaderboard is already down to 184,320.

There's a security argument here too. The usual way to make hashing cheap in a circuit is to pick an arithmetization-oriented design like Poseidon, built out of low-degree power maps over a large prime field. They solve a real problem, but their algebraic structure gives cryptanalysts a lot to pull on, and new attacks keep showing up. Keccak has been hammered on since 2008 and ships in everything. If the proving side can close the performance gap, the standard hash is the easier one to defend.

Why this took nine years

We first proposed KangarooTwelve in 2016, brought it to the CFRG as a draft in 2017, gave TurboSHAKE its own name and identity in 2023 once we realized the underlying sponge function was interesting in its own right, then instantiated the two security levels KT128 and KT256. Publication finally landed in October 2025.

Standards move slowly, and that's mostly a feature. A hash function you're going to build systems on should be scrutinized for years before it gets a stable reference number and an IANA registration. Now it has both: a DOI, COSE algorithm identifiers, and a frozen specification you can cite and implement against.

If you're building something that hashes a lot of data and you have the flexibility to choose your primitive, take a serious look at TurboSHAKE and KangarooTwelve. And if you're shipping an implementation of them and want a second set of eyes, you know where to find us.

Thanks to the co-authors and the CFRG reviewers who carried this across the line.


  1. To put numbers on that, from Jean-Philippe Aumasson's Too Much Crypto: "Practical collision attacks exist for 5-round SHA-3, as successfully implemented on GPUs, with a running time of 40 hours for 5-round SHA3-224 and 473 hours (20 days) for 5-round SHA3-256. For non-standard variants, a practical (complexity $\approx 2^{50}$) collision attack of 6-round Keccak with capacity 160 and output length 160 is documented." 

  2. The SHAKE functions already walk back the capacity choice, which is why they're faster than the SHA3-n instances. 

  3. Flock: Fast Proving for Batch Boolean Computations by Bünz, Rothblum, and Wang. It's a research prototype and the figures are for batches of the same circuit, so take the number with a grain of salt. The authors put it well: the same thing that makes a computation efficient natively, fewer bit operations, is what makes it cheap to prove. 

  4. HopMAC128(Key, M, C, L) = KT128(Key, KT128(M, C, 32), L). The key and the 32-byte inner digest fit in one permutation call as long as the key is at most 69 bytes. 

Keep reading
Recommended

zk.golf: Fearless and Collaborative Optimization of Circuits

zk.golf is a platform where people can compete on creating the most efficient zk circuits for specific problems. It is enabled by what we call "fearless optimization", which is achieved by combining formal verification and frontier AI models. By the end, you will be convinced that nobody should look at constraints ever again in their life.

Giorgio Dell'Immagine, Mathias Hall-Andersen · July 02, 2026

Introducing clean, a formal verification DSL for ZK circuits in Lean4

We're diving into our new project called **clean**, aimed at creating an embedded DSL and formal verification framework for Zero Knowledge (ZK) circuits using Lean4. Imagine being able to not only define ZK circuits but also formally prove their correctness. Sounds like a game-changer, right? We'll walk you through our process of building a robust library of reusable, verified circuit gadgets, focusing on the importance of soundness and completeness. Plus, you'll get a peek at some cool examples like 8-bit addition and how we're tackling ZKVM design with techniques borrowed from Fibonacci sequences. It's exciting stuff, and if you're curious about how we're paving the way for bug-free ZK circuits, this is a read you won't want to miss!

Giorgio Dell'Immagine · March 27, 2025

A Year of ZK Security

A year after launching, we've grown and evolved alongside the world of zero-knowledge proofs, uncovering bugs and learning the ins and outs of ZK technology. From circuit audits to developing our own tools like Circomscribe, it’s been a wild ride. We've discovered how easy it is to misstep with ZK code, especially as these systems grow complex and impact financial security. As zkVMs gain popularity, we're excited about the challenges ahead and are expanding our expertise. Want to dive into the world of ZK with us? Check out our latest projects and even take on our zkBank challenge!

David Wong · May 30, 2024
More to explore

Circle STARKs: Part III, Circle FFT

In this blog post, we explore how to efficiently implement polynomial operations using Circle FFT in the context of STARKs, drawing parallels with the Cooley-Tukey FFT. We discuss how the Circle FFT handles bivariate polynomials over the circle group, replacing traditional multiplicative subgroups with twin-cosets. You'll discover the nuanced process of decomposing and recomposing polynomials using projection and squaring maps, leading to efficient computations. We also address the gap between the polynomial degree space and the space spanned by Circle FFT. This is a fascinating dive into the heart of polynomial computations in cryptography.

Varun Thakore · August 04, 2025

Reproducing and Exploiting ZK Circuit Vulnerabilities

Check out our latest blog post where we dive into the world of Zero-Knowledge Proof (ZKP) vulnerabilities, sharing our insights from replicating known ZK circuit weaknesses. We’ve launched a GitHub repo with detailed scripts to help you understand, reproduce, and learn from these vulnerabilities. Discover how this hands-on approach aids in grasping attack vectors, testing fixes, and enriching educational resources. Whether you're a researcher or a developer, this post is packed with info to enhance your knowledge and skills in ZKP security. Plus, find out how you can contribute to expanding this invaluable resource!

Stefanos Chaliasos, Chenyang Yu · August 09, 2024

zkSecurity took part in judging the latest zkHack Montreal

We recently had the thrill of judging the latest zkHack competition in Montreal, where developers, researchers, and enthusiasts dove into the world of zero-knowledge proofs and privacy tech. The projects were incredibly innovative, featuring creative applications like ZK breathalyzers and ZK & GPS solutions. Check out the exciting results and insights from this year's event. You won't want to miss what these brilliant minds are bringing to the table!

ZK/SEC · September 02, 2024