From nobody Mon Sep 30 03:36:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XH6DV5bK7z5XfP0; Mon, 30 Sep 2024 03:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XH6DV3lmJz43d7; Mon, 30 Sep 2024 03:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727667370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z09bHofWG8J57/JbIBcKVwxiQqr18NaFD9wx4SqDENI=; b=l90Rp0sVD33MM9uJryIZHmuGsJUh7s7DaGSTNUIc0Zz9RGUEyPz1EjBO0jrnjP3eqP4bjJ nwVMhcImVQ/JC2VptQiFiw2nj64T7LKJRX8CtPnrIMQi3wuk0hFAHiyf5vNBFcPf60gyO2 UG17PNt+ouBxwuiYCd0+OUg7SVkvZY8iGAFskhnNSIPaHBYqY6NPFDjo1tSMtKavbZ7cMk 3ox3LBjv08N2Mhzava2pbb0PUwzPBcPrqgBu3iOuKnC0BtvuzJk1DzG89JqPK7gHwYWYhL oklV/3e6slwCnYGjJj8Fiqy7weHfSq+thK/5Qe9MulWeSAKRYSM9+uIukjXFQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727667370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z09bHofWG8J57/JbIBcKVwxiQqr18NaFD9wx4SqDENI=; b=XUbiuDJ0Ic9rTkr+CGffCnSajAsFdcwm7zJQRva9Ai3adOqcNCvOl9LHCSHfJ1D+Wqu00V MBOQYSaKKQZDnqCrUk0tJ3SHx5ppDrV56PqXor0R3fEii4zr9jKgEouZCSCHF7FVRkGtnX Ny8AhCEv3x4ail1JWlveTOaRmMMj9Hx0LqvCr4yE1XOH5qPo/aEnb/G4LkS8is9tlR7Kpq RouzSUERb0YSzIB6FK6mGADGrNQnYtEDgSz29DRB8dO0byak2IwVs76A7qMICnml2blW0N 76hjmckMydWtRtAGevxhVDt85bBxTFEkz56qKhs2767Vpcah0X+ojLOQ6+n/Hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727667370; a=rsa-sha256; cv=none; b=fcNsrzo/TGhjqBD4FmN4PvaEMWGDWXRw4PVBpbmigiLTs2cwrYnTTUCQAvZK22e2CZfpBn osn3NWoJhaOEVlewrrjisJHFp92eqOoOVE0Hj+lBmkTdvNEDcKmaaJ1tDi0iKbI7whQ8wq 8dGq7wIuev7DcH6gIt0wCepZQ/iR8pa0RQ3g/fr2ODw+0PMJN8azv7k8loo77aV4sx8dUj 7Bej7lZoHmoUPv20SMNaISD/0AE4nIjBn08E4DW0MTNZrOM3rff7zkfGaEJ7XIVlI6TWi6 AckRpj1uvw+1OaY4GP1EvgtB9Z9BUPtuUfWMRtcLySDtYcsGIuRJQnUU7O08wA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XH6DV3HtMzcjN; Mon, 30 Sep 2024 03:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48U3aAhe067206; Mon, 30 Sep 2024 03:36:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48U3aAg1067203; Mon, 30 Sep 2024 03:36:10 GMT (envelope-from git) Date: Mon, 30 Sep 2024 03:36:10 GMT Message-Id: <202409300336.48U3aAg1067203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: fd3ced150708 - main - libmd: export and document *Fd/*FdChunk interfaces List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd3ced15070885c818b74a44a0fbe45ed8687f44 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=fd3ced15070885c818b74a44a0fbe45ed8687f44 commit fd3ced15070885c818b74a44a0fbe45ed8687f44 Author: Kyle Evans AuthorDate: 2022-03-08 17:42:52 +0000 Commit: Kyle Evans CommitDate: 2024-09-30 03:34:20 +0000 libmd: export and document *Fd/*FdChunk interfaces PR: 280784 (exp-run) Fixes: de13c2427d6c ("libmd: introduce functions that operate on an fd") Reviewed by: manpages (bcr), fuz Differential Revision: https://reviews.freebsd.org/D34502 --- lib/libmd/mdX.3 | 21 ++++++++++++++++++++- lib/libmd/mdXhl.c | 4 ++++ lib/libmd/ripemd.3 | 21 ++++++++++++++++++++- lib/libmd/sha.3 | 27 ++++++++++++++++++++++++++- lib/libmd/sha256.3 | 27 ++++++++++++++++++++++++++- lib/libmd/sha512.3 | 33 ++++++++++++++++++++++++++++++++- lib/libmd/skein.3 | 33 ++++++++++++++++++++++++++++++++- 7 files changed, 160 insertions(+), 6 deletions(-) diff --git a/lib/libmd/mdX.3 b/lib/libmd/mdX.3 index 26c8b2b43c81..7c86f28ad628 100644 --- a/lib/libmd/mdX.3 +++ b/lib/libmd/mdX.3 @@ -6,7 +6,7 @@ .\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp .\" ---------------------------------------------------------------------------- .\" -.Dd May 21, 2019 +.Dd March 8, 2022 .Dt MDX 3 .Os .Sh NAME @@ -15,6 +15,8 @@ .Nm MDXPad , .Nm MDXFinal , .Nm MDXEnd , +.Nm MDXFd , +.Nm MDXFdChunk , .Nm MDXFile , .Nm MDXFileChunk , .Nm MDXData @@ -35,6 +37,10 @@ .Ft "char *" .Fn MDXEnd "MDX_CTX *context" "char *buf" .Ft "char *" +.Fn MDXFd "int fd" "char *buf" +.Ft "char *" +.Fn MDXFdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn MDXFile "const char *filename" "char *buf" .Ft "char *" .Fn MDXFileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -125,6 +131,19 @@ function calculates the digest of a chunk of data in memory, and uses .Fn MDXEnd to return the result. .Pp +The +.Fn MDXFd +and +.Fn MDXFdChunk +functions are identical to their +.Fn MDXFile +and +.Fn MDXFileChunk +counterparts, with the exception that the first argument is an +.Fa fd +instead of a +.Fa filename . +.Pp When using .Fn MDXEnd , .Fn MDXFile , diff --git a/lib/libmd/mdXhl.c b/lib/libmd/mdXhl.c index 171b97b38794..68598f192056 100644 --- a/lib/libmd/mdXhl.c +++ b/lib/libmd/mdXhl.c @@ -130,6 +130,10 @@ __weak_reference(_libmd_MDXEnd, MDXEnd); __weak_reference(_libmd_MDXFile, MDXFile); #undef MDXFileChunk __weak_reference(_libmd_MDXFileChunk, MDXFileChunk); +#undef MDXFd +__weak_reference(_libmd_MDXFd, MDXFd); +#undef MDXFdChunk +__weak_reference(_libmd_MDXFdChunk, MDXFdChunk); #undef MDXData __weak_reference(_libmd_MDXData, MDXData); #endif diff --git a/lib/libmd/ripemd.3 b/lib/libmd/ripemd.3 index fcd2ea308791..cad07aac8007 100644 --- a/lib/libmd/ripemd.3 +++ b/lib/libmd/ripemd.3 @@ -8,7 +8,7 @@ .\" .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" -.Dd July 20, 2018 +.Dd March 8, 2022 .Dt RIPEMD 3 .Os .Sh NAME @@ -16,6 +16,8 @@ .Nm RIPEMD160_Update , .Nm RIPEMD160_Final , .Nm RIPEMD160_End , +.Nm RIPEMD160_Fd , +.Nm RIPEMD160_FdChunk , .Nm RIPEMD160_File , .Nm RIPEMD160_FileChunk , .Nm RIPEMD160_Data @@ -34,6 +36,10 @@ .Ft "char *" .Fn RIPEMD160_End "RIPEMD160_CTX *context" "char *buf" .Ft "char *" +.Fn RIPEMD160_Fd "int fd" "char *buf" +.Ft "char *" +.Fn RIPEMD160_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn RIPEMD160_File "const char *filename" "char *buf" .Ft "char *" .Fn RIPEMD160_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -106,6 +112,19 @@ function calculates the digest of a chunk of data in memory, and uses .Fn RIPEMD160_End to return the result. .Pp +The +.Fn RIPEMD160_Fd +and +.Fn RIPEMD160_FdChunk +functions are identical to their +.Fn RIPEMD160_File +and +.Fn RIPEMD160_FileChunk +counterparts, with the exception that the first argument is an +.Fa fd +instead of a +.Fa filename . +.Pp When using .Fn RIPEMD160_End , .Fn RIPEMD160_File , diff --git a/lib/libmd/sha.3 b/lib/libmd/sha.3 index 49ee322eacab..e2475f981738 100644 --- a/lib/libmd/sha.3 +++ b/lib/libmd/sha.3 @@ -8,7 +8,7 @@ .\" .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" -.Dd February 6, 2023 +.Dd February 12, 2023 .Dt SHA 3 .Os .Sh NAME @@ -16,6 +16,8 @@ .Nm SHA_Update , .Nm SHA_Final , .Nm SHA_End , +.Nm SHA_Fd , +.Nm SHA_FdChunk , .Nm SHA_File , .Nm SHA_FileChunk , .Nm SHA_Data , @@ -23,6 +25,8 @@ .Nm SHA1_Update , .Nm SHA1_Final , .Nm SHA1_End , +.Nm SHA1_Fd , +.Nm SHA1_FdChunk , .Nm SHA1_File , .Nm SHA1_FileChunk , .Nm SHA1_Data @@ -41,6 +45,10 @@ .Ft "char *" .Fn SHA_End "SHA_CTX *context" "char *buf" .Ft "char *" +.Fn SHA_Fd "int fd" "char *buf" +.Ft "char *" +.Fn SHA_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn SHA_File "const char *filename" "char *buf" .Ft "char *" .Fn SHA_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -55,6 +63,10 @@ .Ft "char *" .Fn SHA1_End "SHA_CTX *context" "char *buf" .Ft "char *" +.Fn SHA1_Fd "int fd" "char *buf" +.Ft "char *" +.Fn SHA1_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn SHA1_File "const char *filename" "char *buf" .Ft "char *" .Fn SHA1_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -130,6 +142,19 @@ calculates the digest of a chunk of data in memory, and uses .Fn SHA1_End to return the result. .Pp +The +.Fn SHA1_Fd +and +.Fn SHA1_FdChunk +functions are identical to their +.Fn SHA1_File +and +.Fn SHA1_FileChunk +counterparts, with the exception that the first argument is an +.Fa fd +instead of a +.Fa filename . +.Pp When using .Fn SHA1_End , .Fn SHA1_File , diff --git a/lib/libmd/sha256.3 b/lib/libmd/sha256.3 index e22258f40140..406dfd1b357d 100644 --- a/lib/libmd/sha256.3 +++ b/lib/libmd/sha256.3 @@ -8,7 +8,7 @@ .\" .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" -.Dd July 20, 2018 +.Dd March 8, 2022 .Dt SHA256 3 .Os .Sh NAME @@ -16,6 +16,8 @@ .Nm SHA224_Update , .Nm SHA224_Final , .Nm SHA224_End , +.Nm SHA224_Fd , +.Nm SHA224_FdChunk , .Nm SHA224_File , .Nm SHA224_FileChunk , .Nm SHA224_Data , @@ -23,6 +25,8 @@ .Nm SHA256_Update , .Nm SHA256_Final , .Nm SHA256_End , +.Nm SHA256_Fd , +.Nm SHA256_FdChunk , .Nm SHA256_File , .Nm SHA256_FileChunk , .Nm SHA256_Data @@ -41,6 +45,10 @@ .Ft "char *" .Fn SHA224_End "SHA224_CTX *context" "char *buf" .Ft "char *" +.Fn SHA224_Fd "int fd" "char *buf" +.Ft "char *" +.Fn SHA224_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn SHA224_File "const char *filename" "char *buf" .Ft "char *" .Fn SHA224_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -56,6 +64,10 @@ .Ft "char *" .Fn SHA256_End "SHA256_CTX *context" "char *buf" .Ft "char *" +.Fn SHA256_Fd "int fd" "char *buf" +.Ft "char *" +.Fn SHA256_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn SHA256_File "const char *filename" "char *buf" .Ft "char *" .Fn SHA256_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -125,6 +137,19 @@ calculates the digest of a chunk of data in memory, and uses .Fn SHA256_End to return the result. .Pp +The +.Fn SHA256_Fd +and +.Fn SHA256_FdChunk +functions are identical to their +.Fn SHA256_File +and +.Fn SHA256_FileChunk +counterparts, with the exception that the first argument is an +.Fa fd +instead of a +.Fa filename . +.Pp When using .Fn SHA256_End , .Fn SHA256_File , diff --git a/lib/libmd/sha512.3 b/lib/libmd/sha512.3 index a5c478efa9ae..17d0d0988350 100644 --- a/lib/libmd/sha512.3 +++ b/lib/libmd/sha512.3 @@ -8,7 +8,7 @@ .\" .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" -.Dd February 3, 2023 +.Dd February 12, 2023 .Dt SHA512 3 .Os .Sh NAME @@ -16,6 +16,8 @@ .Nm SHA512_Update , .Nm SHA512_Final , .Nm SHA512_End , +.Nm SHA512_Fd , +.Nm SHA512_FdChunk , .Nm SHA512_File , .Nm SHA512_FileChunk , .Nm SHA512_Data , @@ -23,6 +25,8 @@ .Nm SHA384_Update , .Nm SHA384_Final , .Nm SHA384_End , +.Nm SHA384_Fd , +.Nm SHA384_FdChunk , .Nm SHA384_File , .Nm SHA384_FileChunk , .Nm SHA384_Data , @@ -37,6 +41,8 @@ .Nm SHA512_256_Update , .Nm SHA512_256_Final , .Nm SHA512_256_End , +.Nm SHA512_256_Fd , +.Nm SHA512_256_FdChunk , .Nm SHA512_256_File , .Nm SHA512_256_FileChunk , .Nm SHA512_256_Data @@ -55,6 +61,10 @@ .Ft "char *" .Fn SHA512_End "SHA512_CTX *context" "char *buf" .Ft "char *" +.Fn SHA512_Fd "int fd" "char *buf" +.Ft "char *" +.Fn SHA512_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn SHA512_File "const char *filename" "char *buf" .Ft "char *" .Fn SHA512_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -70,6 +80,10 @@ .Ft "char *" .Fn SHA384_End "SHA384_CTX *context" "char *buf" .Ft "char *" +.Fn SHA384_Fd "int fd" "char *buf" +.Ft "char *" +.Fn SHA384_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn SHA384_File "const char *filename" "char *buf" .Ft "char *" .Fn SHA384_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -99,6 +113,10 @@ .Ft "char *" .Fn SHA512_256_End "SHA512_CTX *context" "char *buf" .Ft "char *" +.Fn SHA512_256_Fd "int fd" "char *buf" +.Ft "char *" +.Fn SHA512_256_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn SHA512_256_File "const char *filename" "char *buf" .Ft "char *" .Fn SHA512_256_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -168,6 +186,19 @@ calculates the digest of a chunk of data in memory, and uses .Fn SHA512_End to return the result. .Pp +The +.Fn SHA512_Fd +and +.Fn SHA512_FdChunk +functions are identical to their +.Fn SHA512_File +and +.Fn SHA512_FileChunk +counterparts, with the exception that the first argument is an +.Fa fd +instead of a +.Fa filename . +.Pp When using .Fn SHA512_End , .Fn SHA512_File , diff --git a/lib/libmd/skein.3 b/lib/libmd/skein.3 index 1dff9e2c92dc..8fe79a4ad0bf 100644 --- a/lib/libmd/skein.3 +++ b/lib/libmd/skein.3 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 21, 2019 +.Dd March 8, 2022 .Dt SKEIN 3 .Os .Sh NAME @@ -31,6 +31,8 @@ .Nm SKEIN256_Update , .Nm SKEIN256_Final , .Nm SKEIN256_End , +.Nm SKEIN256_Fd , +.Nm SKEIN256_FdChunk , .Nm SKEIN256_File , .Nm SKEIN256_FileChunk , .Nm SKEIN256_Data , @@ -38,6 +40,8 @@ .Nm SKEIN512_Update , .Nm SKEIN512_Final , .Nm SKEIN512_End , +.Nm SKEIN512_Fd , +.Nm SKEIN512_FdChunk , .Nm SKEIN512_File , .Nm SKEIN512_FileChunk , .Nm SKEIN512_Data , @@ -45,6 +49,8 @@ .Nm SKEIN1024_Update , .Nm SKEIN1024_Final , .Nm SKEIN1024_End , +.Nm SKEIN1024_Fd , +.Nm SKEIN1024_FdChunk , .Nm SKEIN1024_File , .Nm SKEIN1024_FileChunk , .Nm SKEIN1024_Data @@ -63,6 +69,10 @@ .Ft "char *" .Fn SKEIN256_End "SKEIN256_CTX *context" "char *buf" .Ft "char *" +.Fn SKEIN256_Fd "int fd" "char *buf" +.Ft "char *" +.Fn SKEIN256_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn SKEIN256_File "const char *filename" "char *buf" .Ft "char *" .Fn SKEIN256_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -77,6 +87,10 @@ .Ft "char *" .Fn SKEIN512_End "SKEIN512_CTX *context" "char *buf" .Ft "char *" +.Fn SKEIN512_Fd "int fd" "char *buf" +.Ft "char *" +.Fn SKEIN512_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn SKEIN512_File "const char *filename" "char *buf" .Ft "char *" .Fn SKEIN512_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -91,6 +105,10 @@ .Ft "char *" .Fn SKEIN1024_End "SKEIN1024_CTX *context" "char *buf" .Ft "char *" +.Fn SKEIN1024_Fd "int fd" "char *buf" +.Ft "char *" +.Fn SKEIN1024_FdChunk "int fd" "char *buf" "off_t offset" "off_t length" +.Ft "char *" .Fn SKEIN1024_File "const char *filename" "char *buf" .Ft "char *" .Fn SKEIN1024_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" @@ -160,6 +178,19 @@ calculates the digest of a chunk of data in memory, and uses .Fn SKEIN256_End to return the result. .Pp +The +.Fn SKEIN256_Fd +and +.Fn SKEIN256_FdChunk +functions are identical to their +.Fn SKEIN256_File +and +.Fn SKEIN256_FileChunk +counterparts, with the exception that the first argument is an +.Fa fd +instead of a +.Fa filename . +.Pp When using .Fn SKEIN256_End , .Fn SKEIN256_File ,