summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2022-08-07 21:03:56 +0200
committerNiels Möller <nisse@lysator.liu.se>2022-08-07 21:03:56 +0200
commit9830fe90540616bc7392fc95213383c47969514b (patch)
tree1c55ab3b848180b599168a57dae1ae094429cb5a
parent79e51eaa66233a6980d34d4ca9441105688b3836 (diff)
downloadnettle-9830fe90540616bc7392fc95213383c47969514b.tar.gz
Document hash compress functions, based on patch from Corentin Labbe.
-rw-r--r--ChangeLog4
-rw-r--r--nettle.texinfo31
2 files changed, 35 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f7654a82..b545f7ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2022-08-07 Niels Möller <nisse@lysator.liu.se>
+ 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{<nettle/sha.h>}, 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