Extendable-output functions

Kangarootwelve

A fast tree-hashing XOF over 12-round Keccak, standardised in RFC 9861

standard Safe API

About Kangarootwelve

Kangarootwelve is an extendable-output function (XOF). It takes the parameter custom. Its registry entry cites RFC 9861. It is also known as k12. NextSSL lists it in the standard tier and exposes it through the safe API.

Overview

KangarooTwelve (K12) is an extendable-output function from the Keccak team that uses a 12-round Keccak permutation and a tree mode for long inputs. It offers 128-bit security at several times the speed of SHAKE128.

K12 is built on TurboSHAKE128, which is SHAKE128 with the Keccak permutation reduced from 24 to 12 rounds. Inputs up to 8 KiB are hashed directly. Longer inputs are split into 8 KiB chunks; every chunk after the first is hashed independently into a 256-bit chaining value, and these values are appended to the first chunk and hashed in a final node. The chunks can be processed in parallel with SIMD or multiple cores.

K12 was introduced in 2016 and standardised, together with TurboSHAKE and the 256-bit-security KT256, in RFC 9861. It takes an optional customisation string. NextSSL includes KangarooTwelve (KT128). KT128 provides 128-bit security against all attacks, with output of any length. Its speed comes from both the reduced round count and the ability to process several chunks at once using vector instructions.

History

2016–2025
  1. KangarooTwelve published by the Keccak team

  2. Specified in RFC 9861

Security notes

The 12-round Keccak permutation retains a large security margin: the best published attacks on Keccak reach about six rounds. No weaknesses specific to K12 are known.

Typical uses

Fast hashing of large filesParallel or SIMD-accelerated XOF outputProtocols wanting Keccak with better performance

Sizes

The registry declares no fixed sizes for this algorithm.

Parameters

NameTypeRangeDefaultRequired
custom bytes 0 – 65536 — 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
out = ns.call("xof", "kangarootwelve", None, b"abc", 64)[0]   # any length

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Frequently asked questions

What is Kangarootwelve?

Kangarootwelve is a XOF in the KangarooTwelve family. KangarooTwelve (K12) is an extendable-output function from the Keccak team that uses a 12-round Keccak permutation and a tree mode for long inputs. It is also known as k12.

Who designed Kangarootwelve and when?

Kangarootwelve belongs to the KangarooTwelve family, first published in 2016 by Guido Bertoni, Joan Daemen, Michaël Peeters, Gilles Van Assche, Ronny Van Keer, Benoît Viguier. Its origin: RFC 9861.

Which standards define Kangarootwelve?

Kangarootwelve is referenced by RFC 9861.

Is Kangarootwelve safe to use?

Kangarootwelve is in the standard tier. Standardised and sound. Reachable from the safe API. It can be called from the safe API.