cSHAKE is a customizable extendable output function (XOF) in the SHA-3 family. Like SHAKE, it produces an output of any requested length; unlike SHAKE, it accepts a function-name string and an optional customization string. Different customization strings produce different deterministic outputs, enabling domain separation between cryptographic uses. section 2.5.3 section 2.7
Use cSHAKE when one underlying construction must behave like separate XOFs:
- Choose a distinct customization string for each protocol role or use case. section 2.5.3
- Request digest lengths suited to the application, including random-number or key-derivation outputs. section 2.5.3
- Recognize KMAC as a wrapper that feeds encoded key, input, output length, function name, and optional customization into cSHAKE. section 3.5.2
Two customized outputs
For input "hello world" and a 256-bit output, customization "my_hash" produces 72444fde79690f0cac19e866d7e6505c, while "your_hash" produces 688a49e8c2a1e1ab4e78f887c1c73957. section 2.5.3
cSHAKE(input="hello world", output_length=256, custom_string="my_hash") -> 72444fde79690f0cac19e866d7e6505c cSHAKE(input="hello world", output_length=256, custom_string="your_hash") -> 688a49e8c2a1e1ab4e78f887c1c73957
Compare cSHAKE calls directly and see how changing only the customization string changes the result. section 2.5.3
