# crypto.sha3: implement constructions from NIST SP 800-185 \(\#19533\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9d27f34d04154069e2c2c37af99f35a50ac4bd9e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9d27f34d04154069e2c2c37af99f35a50ac4bd9e

Requested commit: 9d27f34d04154069e2c2c37af99f35a50ac4bd9e

Commit: 9d27f34d04154069e2c2c37af99f35a50ac4bd9e

Tree: 90088c3a7395b3e534dc937c802f47b6940ceea7

Author: Frank Denis

Committer: GitHub

## Message

```
crypto.sha3: implement constructions from NIST SP 800-185 (#19533)

https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf

This adds useful standard SHA3-based constructions from the
NIST SP 800-185 document:

- cSHAKE: similar to the SHAKE extensible hash function, but
with the addition of a context parameter.
- KMAC: SHAKE-based authentication / keyed XOF
- TupleHash: unambiguous hashing of tuples

These are required by recent protocols and specifications.

They also offer properties that none of the currently available
constructions in the stdlib offer, especially the ability to safely
hash tuples.

Other keyed hash functions/XOFs will fall back to using HMAC, which
is suboptimal from a performance perspective, but fine from a
security perspective.
```

## Parents

- [ac21ade667f0f42b8b1aec5831cbc99cbaed8565](https://git.cafe/gitcafe/zig/commit/ac21ade667f0f42b8b1aec5831cbc99cbaed8565?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9d27f34d04154069e2c2c37af99f35a50ac4bd9e?format=markdown)
