From 57fa68a34869752d049acdc37b85df0ff75a7c9d Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date: Sun, 11 Nov 2012 14:22:56 +0100
Subject: [PATCH] Documentation of gost hash.

---
 ChangeLog      |  6 ++++++
 nettle.texinfo | 43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e6fa5857..a39733dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-11  Niels Möller  <nisse@lysator.liu.se>
+
+	From Nikos Mavrogiannopoulos:
+	* nettle.texinfo (Hash functions): Added documentation for
+	gosthash94.
+
 2012-11-10  Niels Möller  <nisse@lysator.liu.se>
 
 	* nettle.texinfo (nettle_hashes, nettle_ciphers): Use deftypevr,
diff --git a/nettle.texinfo b/nettle.texinfo
index b5ef14b9..ea4b1582 100644
--- a/nettle.texinfo
+++ b/nettle.texinfo
@@ -220,6 +220,11 @@ released under the LGPL.
 Written by @value{AUTHOR}, using Peter Gutmann's SHA1 code as a model. 
 Released under the LGPL.
 
+@item GOSTHASH94
+The C implementation of the GOST94 message digest is written by 
+Aleksey Kravchenko and was ported from the rhash library by Nikos
+Mavrogiannopoulos. It is released under the MIT license.
+
 @item TWOFISH
 The implementation of the TWOFISH cipher is written by Ruud de Rooij.
 Released under the LGPL.
@@ -711,6 +716,43 @@ This function also resets the context in the same way as
 @code{sha384_init}.
 @end deftypefun
 
+@subsection @acronym{GOSTHASH94}
+
+The GOST94 or GOST R 34.11-94 hash algorithm is a Soviet-era algorithm 
+used in Russian government standards (see @cite{RFC 4357}).
+It outputs message digests of 256 bits, or 32 octets.
+Nettle defines GOSTHASH94 in @file{<nettle/gosthash94.h>}.
+
+@deftp {Context struct} {struct gosthash94_ctx}
+@end deftp
+
+@defvr Constant GOSTHASH94_DIGEST_SIZE
+The size of an GOSTHASH94 digest, i.e. 32.
+@end defvr
+
+@defvr Constant GOSTHASH94_DATA_SIZE
+The internal block size of GOSTHASH94, i.e., 32.
+@end defvr
+
+@deftypefun void gosthash94_init (struct gosthash94_ctx *@var{ctx})
+Initialize the GOSTHASH94 state.
+@end deftypefun
+
+@deftypefun void gosthash94_update (struct gosthash94_ctx *@var{ctx}, unsigned @var{length}, const uint8_t *@var{data})
+Hash some more data.
+@end deftypefun
+
+@deftypefun void gosthash94_digest (struct gosthash94_ctx *@var{ctx}, unsigned @var{length}, uint8_t *@var{digest})
+Performs final processing and extracts the message digest, writing it
+to @var{digest}. @var{length} may be smaller than
+@code{GOSTHASH94_DIGEST_SIZE}, in which case only the first @var{length}
+octets of the digest are written.
+
+This function also resets the context in the same way as
+@code{gosthash94_init}.
+@end deftypefun
+
+
 @subsection @code{struct nettle_hash}
 
 Nettle includes a struct including information about the supported hash
@@ -735,6 +777,7 @@ The last three attributes are function pointers, of types
 @deftypevrx {Constant Struct} {struct nettle_hash} nettle_sha256
 @deftypevrx {Constant Struct} {struct nettle_hash} nettle_sha384
 @deftypevrx {Constant Struct} {struct nettle_hash} nettle_sha512
+@deftypevrx {Constant Struct} {struct nettle_hash} nettle_gosthash94
 These are all the hash functions that Nettle implements.
 @end deftypevr
 
-- 
GitLab