From: Niels Möller Date: Sun, 7 Aug 2022 19:03:56 +0000 (+0200) Subject: Document hash compress functions, based on patch from Corentin Labbe. X-Git-Tag: nettle_3.9_release_20230514~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9830fe90540616bc7392fc95213383c47969514b;p=thirdparty%2Fnettle.git Document hash compress functions, based on patch from Corentin Labbe. --- diff --git a/ChangeLog b/ChangeLog index f7654a82..b545f7ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2022-08-07 Niels Möller + Based on patch from Corentin Labbe: + * nettle.texinfo: Document sha256_compress, sha512_compress, + md5_compress and sha1_compress. + * configure.ac: Refer to nettle-types.h, rather than arcfour.c, for AC_CONFIG_SRCDIR. diff --git a/nettle.texinfo b/nettle.texinfo index 69f9bcaf..49c986d1 100644 --- a/nettle.texinfo +++ b/nettle.texinfo @@ -442,6 +442,14 @@ This function also resets the context in the same way as @code{sha256_init}. @end deftypefun +@deftypefun void sha256_compress (const uint32_t *@var{state}, uint8_t *@var{input}) +Perform a raw SHA256 compress on SHA256_BLOCK_SIZE bytes from@var{input} +using @var{state} as IV (an array of 8 uint32_t). The output is stored in @var{state}. +This function provides access to the underlying compression function, +for the rare applications that need that (e.g., using different IV from +standard SHA256). +@end deftypefun + Earlier versions of nettle defined SHA256 in the header file @file{}, which is now deprecated, but kept for compatibility. @@ -522,6 +530,14 @@ This function also resets the context in the same way as @code{sha512_init}. @end deftypefun +@deftypefun void sha512_compress (const uint64_t *@var{state}, uint8_t *@var{input}) +Perform a raw SHA512 compress on SHA512_BLOCK_SIZE bytes from +@var{input} using @var{state} as IV (an array of 8 uint64_t). The output is stored in @var{state}. +This function provides access to the underlying compression function, +for the rare applications that need that (e.g., using different IV from +standard SHA512). +@end deftypefun + @subsubsection @acronym{SHA384 and other variants of SHA512} Several variants of SHA512 have been defined, with a different initial @@ -929,6 +945,14 @@ This function also resets the context in the same way as @code{md5_init}. @end deftypefun +@deftypefun void md5_compress (const uint32_t *@var{state}, uint8_t *@var{input}) +Perform a raw MD5 compress on MD5_BLOCK_SIZE bytes from @var{input} +using @var{state} as IV (an array of 4 uint32_t). The output is stored in @var{state}. +This function provides access to the underlying compression function, +for the rare applications that need that (e.g., using different IV from +standard MD5). +@end deftypefun + The normal way to use MD5 is to call the functions in order: First @code{md5_init}, then @code{md5_update} zero or more times, and finally @code{md5_digest}. After @code{md5_digest}, the context is reset to @@ -1083,6 +1107,13 @@ This function also resets the context in the same way as @code{sha1_init}. @end deftypefun +@deftypefun void sha1_compress (const uint32_t *@var{state}, uint8_t *@var{input}) +Perform a raw SHA1 compress on SHA1_BLOCK_SIZE bytes from @var{input} +using @var{state} as IV (an array of 5 uint32_t). The output is stored in @var{state}. +This function provides access to the underlying compression function, +for the rare applications that need that (e.g., using different IV from +standard SHA1). +@end deftypefun @subsubsection @acronym{GOSTHASH94 and GOSTHASH94CP} @cindex GOST hash