SHA3_SELFTEST(3) Library Functions Manual SHA3_SELFTEST(3)

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

Message Digest (MD4, MD5, etc.) Support Library (libmd, -lmd)

#include <sha3.h>

int
SHA3_Selftest(void);

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 () and confirm that it succeeded before using the sha3(3), or shake(3) functions.

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

The () 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.

sha3(3), shake(3)

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

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

October 14, 2015 Linux 7.0.5-arch1-1