Extendable-output functions

Cshake256

Customisable SHAKE from SP 800-185, adding function-name and customisation strings

standard Safe API Specified in a FIPS standard

About Cshake256

Cshake256 is one of 2 cSHAKE variants in the NextSSL registry, an extendable-output function (XOF). It takes the parameter custom. Its registry entry cites NIST SP 800-185. NextSSL lists it in the standard tier and exposes it through the safe API.

Overview

cSHAKE is a customisable variant of SHAKE defined in NIST SP 800-185. It adds two inputs, a function name and a customisation string, so that different applications obtain independent functions from the same Keccak sponge.

cSHAKE encodes the function name N and customisation string S with length prefixes, pads them to a multiple of the sponge rate, and absorbs this block before the message, using a different domain-separation suffix from SHAKE. When both N and S are empty, cSHAKE is defined to be identical to SHAKE. NIST reserves function names for its own derived functions such as KMAC, TupleHash and ParallelHash.

NextSSL includes cSHAKE128 and cSHAKE256, providing 128-bit and 256-bit security levels. Applications should choose a unique customisation string, such as a protocol name and version, so that outputs used in different contexts cannot be confused or substituted for one another. The function name parameter is reserved for NIST-defined functions. Strings are public.

History

2016–2016
  1. Specified in NIST SP 800-185

Security notes

cSHAKE inherits Keccak's security with no known weaknesses. Customisation strings provide domain separation only; they are not secret and do not act as keys.

Typical uses

Domain-separated hashingBuilding KMAC, TupleHash and ParallelHashProtocol-specific XOFs

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", "cshake256", 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.

Other cSHAKE variants

1

Frequently asked questions

What is Cshake256?

Cshake256 is a XOF in the cSHAKE family. cSHAKE is a customisable variant of SHAKE defined in NIST SP 800-185.

Who designed Cshake256 and when?

Cshake256 belongs to the cSHAKE family, first published in 2016. Its origin: NIST SP 800-185.

Which standards define Cshake256?

Cshake256 is referenced by NIST SP 800-185. It is specified in a FIPS standard.

Is Cshake256 safe to use?

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

What other cSHAKE variants are there?

NextSSL also registers cshake128 in the cSHAKE family.