SHA3_Selftest(3)

SHA3_Selftest3

Nist fips pub 202: sha-3 standard: permutation-based hash and extendable-output functions

Usage

#include <sha3.h>

int

SHA3_Selftest(void);

Library

library “libmd”

Overview

The SHA3_Selftest function automatically tests a number of SHA-3 computations on fixed inputs with with known outputs to make sure the sha3(3) library is not catastrophically broken. Applications should call SHA3_Selftest() and confirm that it succeeded before using the sha3(3), or shake(3) functions.

SHA3_Selftest() returns 0 if successful, or -1 if the self-test failed.

The SHA3_Selftest() function costs a few hundred thousand cycles on most CPUs, since it involves a little over a hundred calls to the Keccak permutation, which usually take one or two thousand cycles each.

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 ⟨[email protected]⟩

From libmd 1.3.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's mdoc source.