$NetBSD: SHA3_Selftest.3,v 1.1 2017/11/30 16:00:48 wiz Exp $
Copyright (c) 2015 Taylor R. Campbell
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
.Dd October 14, 2015 .Dt SHA3_SELFTEST 3 .Os .Sh NAME .Nm SHA3_Selftest .Nd NIST FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions .Sh SYNOPSIS n sha3.h .Ft int .Fn SHA3_Selftest "void" .Sh DESCRIPTION The .Nm function automatically tests a number of SHA-3 computations on fixed inputs with with known outputs to make sure the .Xr sha3 3 library is not catastrophically broken. Applications should call .Fn SHA3_Selftest and confirm that it succeeded before using the .Xr sha3 3 , .Xr SHAKE 3 , or .Xr keccak 3 functions.
Copyright (c) 2015 Taylor R. Campbell
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
.Dd October 14, 2015 .Dt SHA3_SELFTEST 3 .Os .Sh NAME .Nm SHA3_Selftest .Nd NIST FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions .Sh SYNOPSIS n sha3.h .Ft int .Fn SHA3_Selftest "void" .Sh DESCRIPTION The .Nm function automatically tests a number of SHA-3 computations on fixed inputs with with known outputs to make sure the .Xr sha3 3 library is not catastrophically broken. Applications should call .Fn SHA3_Selftest and confirm that it succeeded before using the .Xr sha3 3 , .Xr SHAKE 3 , or .Xr keccak 3 functions.
p .Fn SHA3_Selftest returns 0 if successful, or -1 if the self-test failed.
p The .Fn 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. .Sh SEE ALSO .Xr keccak 3 , .Xr sha3 3 , .Xr SHAKE 3 .Sh STANDARDS .Rs .%A National Institute of Standards and Technology .%T SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions .%O FIPS PUB 202 .%D August 2015 .Re .Sh AUTHORS .An Taylor R Campbell Aq campbell+sha3@mumble.net