From bed12096d7fe0787c9d409b7f2a11c164bed8494 Mon Sep 17 00:00:00 2001 From: schwarze Date: Mon, 14 Aug 2023 14:22:32 +0000 Subject: [PATCH] import EVP_sha3_224(3) from the OpenSSL 1.1 branch, which is still under a free license, tweaked by me --- lib/libcrypto/man/EVP_DigestInit.3 | 5 +- lib/libcrypto/man/EVP_sha3_224.3 | 92 ++++++++++++++++++++++++++++++ lib/libcrypto/man/Makefile | 3 +- 3 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 lib/libcrypto/man/EVP_sha3_224.3 diff --git a/lib/libcrypto/man/EVP_DigestInit.3 b/lib/libcrypto/man/EVP_DigestInit.3 index 6c75adcc98b..2d790cb2c01 100644 --- a/lib/libcrypto/man/EVP_DigestInit.3 +++ b/lib/libcrypto/man/EVP_DigestInit.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_DigestInit.3,v 1.27 2023/08/12 16:12:19 schwarze Exp $ +.\" $OpenBSD: EVP_DigestInit.3,v 1.28 2023/08/14 14:22:32 schwarze Exp $ .\" full merge up to: OpenSSL 7f572e95 Dec 2 13:57:04 2015 +0000 .\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 .\" @@ -70,7 +70,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 12 2023 $ +.Dd $Mdocdate: August 14 2023 $ .Dt EVP_DIGESTINIT 3 .Os .Sh NAME @@ -830,6 +830,7 @@ main(int argc, char *argv[]) .Xr EVP_MD_meth_new 3 , .Xr EVP_PKEY_CTX_set_signature_md 3 , .Xr EVP_PKEY_meth_set_signctx 3 , +.Xr EVP_sha3_224 3 , .Xr EVP_SignInit 3 , .Xr EVP_sm3 3 , .Xr EVP_VerifyInit 3 , diff --git a/lib/libcrypto/man/EVP_sha3_224.3 b/lib/libcrypto/man/EVP_sha3_224.3 new file mode 100644 index 00000000000..f8f473ce8ef --- /dev/null +++ b/lib/libcrypto/man/EVP_sha3_224.3 @@ -0,0 +1,92 @@ +.\" $OpenBSD: EVP_sha3_224.3,v 1.1 2023/08/14 14:22:32 schwarze Exp $ +.\" selective merge up to: OpenSSL bbda8ce9 Oct 31 15:43:01 2017 +0800 +.\" +.\" This file was written by Ronald Tse . +.\" Copyright (c) 2017 The OpenSSL Project. 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. +.\" +.\" 3. All advertising materials mentioning features or use of this +.\" software must display the following acknowledgment: +.\" "This product includes software developed by the OpenSSL Project +.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +.\" +.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +.\" endorse or promote products derived from this software without +.\" prior written permission. For written permission, please contact +.\" openssl-core@openssl.org. +.\" +.\" 5. Products derived from this software may not be called "OpenSSL" +.\" nor may "OpenSSL" appear in their names without prior written +.\" permission of the OpenSSL Project. +.\" +.\" 6. Redistributions of any form whatsoever must retain the following +.\" acknowledgment: +.\" "This product includes software developed by the OpenSSL Project +.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +.\" EXPRESSED 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 OpenSSL PROJECT OR +.\" ITS 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 $Mdocdate: August 14 2023 $ +.Dt EVP_SHA3_224 3 +.Os +.Sh NAME +.Nm EVP_sha3_224 , +.Nm EVP_sha3_256 , +.Nm EVP_sha3_384 , +.Nm EVP_sha3_512 +.Nd Secure Hash Algorithm 3 for EVP +.Sh SYNOPSIS +.In openssl/evp.h +.Ft const EVP_MD * +.Fn EVP_sha3_224 void +.Ft const EVP_MD * +.Fn EVP_sha3_256 void +.Ft const EVP_MD * +.Fn EVP_sha3_384 void +.Ft const EVP_MD * +.Fn EVP_sha3_512 void +.Sh DESCRIPTION +SHA-3 (Secure Hash Algorithm 3) is a family of cryptographic hash +functions standardized in NIST FIPS 202, first published in 2015. +It is based on the Keccak algorithm. +.Pp +.Fn EVP_sha3_224 , +.Fn EVP_sha3_256 , +.Fn EVP_sha3_384 , +and +.Fn EVP_sha3_512 +implement the SHA3-224, SHA3-256, SHA3-384, and SHA3-512 algorithms +and produce 224, 256, 384 and 512 bits of output from a given input, +respectively. +.Sh RETURN VALUES +These functions return pointers to static +.Vt EVP_MD +objects that contain the implementations of the symmetric ciphers. +.Sh SEE ALSO +.Xr evp 3 , +.Xr EVP_DigestInit 3 , +.Xr EVP_MD_meth_new 3 +.Sh STANDARDS +NIST FIPS 202 diff --git a/lib/libcrypto/man/Makefile b/lib/libcrypto/man/Makefile index 23e48a98777..3e216956af2 100644 --- a/lib/libcrypto/man/Makefile +++ b/lib/libcrypto/man/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.259 2023/07/28 05:48:33 tb Exp $ +# $OpenBSD: Makefile,v 1.260 2023/08/14 14:22:32 schwarze Exp $ .include @@ -202,6 +202,7 @@ MAN= \ EVP_camellia_128_cbc.3 \ EVP_des_cbc.3 \ EVP_rc4.3 \ + EVP_sha3_224.3 \ EVP_sm3.3 \ EVP_sm4_cbc.3 \ EVP_whirlpool.3 \ -- 2.20.1