---
name: "sha3"
section: "3"
platform: "linux"
package: "libmd"
version: "1.3.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/sha3"
---

# sha3(3)

NIST FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions

## NAME

**SHA3** – NIST FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions

## LIBRARY

library “libmd”

## SYNOPSIS

**#include \<sha3.h\>**

*void*\

**SHA3\_224\_Init**(*SHA3\_224\_CTX \*ctx*);

*void*\

**SHA3\_224\_Update**(*SHA3\_224\_CTX \*ctx*, *const uint8\_t \*buf*, *size\_t len*);

*void*\

**SHA3\_224\_Final**(*uint8\_t digest\[SHA3\_224\_DIGEST\_LENGTH\]*, *SHA3\_224\_CTX \*ctx*);

*void*\

**SHA3\_256\_Init**(*SHA3\_256\_CTX \*ctx*);

*void*\

**SHA3\_256\_Update**(*SHA3\_256\_CTX \*ctx*, *const uint8\_t \*buf*, *size\_t len*);

*void*\

**SHA3\_256\_Final**(*uint8\_t digest\[SHA3\_256\_DIGEST\_LENGTH\]*, *SHA3\_256\_CTX \*ctx*);

*void*\

**SHA3\_384\_Init**(*SHA3\_384\_CTX \*ctx*);

*void*\

**SHA3\_384\_Update**(*SHA3\_384\_CTX \*ctx*, *const uint8\_t \*buf*, *size\_t len*);

*void*\

**SHA3\_384\_Final**(*uint8\_t digest\[SHA3\_384\_DIGEST\_LENGTH\]*, *SHA3\_384\_CTX \*ctx*);

*void*\

**SHA3\_512\_Init**(*SHA3\_512\_CTX \*ctx*);

*void*\

**SHA3\_512\_Update**(*SHA3\_512\_CTX \*ctx*, *const uint8\_t \*buf*, *size\_t len*);

*void*\

**SHA3\_512\_Final**(*uint8\_t digest\[SHA3\_512\_DIGEST\_LENGTH\]*, *SHA3\_512\_CTX \*ctx*);

## DESCRIPTION

The **SHA3** functions implement the cryptographic hash functions of the NIST SHA-3 standard, FIPS PUB 202. The **SHA3** functions compress an arbitrary-length message m into short fixed-length octet strings SHA3-224(m), SHA3-256(m), etc., called a cryptographic digest or hash.

Before using the **SHA3** functions, applications should first call [SHA3\_Selftest(3)](/SHA3_Selftest/3.md) and confirm that it succeeded.

Only the **SHA3\_256** functions are specified in detail; the **SHA3\_224**, **SHA3\_384**, and **SHA3\_512** functions are exactly analogous.

The caller must allocate memory for a *SHA3\_256\_CTX* object to hold the state of a SHA3-256 hash computation over a message. *SHA3\_256\_CTX* objects are slightly over 200 bytes, and may be copied or relocated in memory.

- **SHA3\_256\_Init**(*ctx*)

  Initialize a SHA3-256 context. Must be done before any other operations on *ctx*.

- **SHA3\_256\_Update**(*ctx*, *data*, *len*)

  Append *len* octets at *data* to the message.

- **SHA3\_256\_Final**(*digest*, *ctx*)

  Store at *digest* the 32-octet SHA3-256 hash of the message obtained by concatenating all prior inputs to **SHA3\_256\_Update**() on *ctx*.

  Subsequent use of *ctx* is not allowed, unless it is reinitialized with **SHA3\_256\_Init**().

## SEE ALSO

[SHA3\_Selftest(3)](/SHA3_Selftest/3.md), [shake(3)](/shake/3.md)

## STANDARDS

National Institute of Standards and Technology, *SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions*, August 2015, FIPS PUB 202.

## AUTHORS

Taylor R Campbell ⟨campbell+sha3@mumble.net⟩
