From a7dba70c5f090c0b14faeae61e19d2acea4088b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Mon, 20 Mar 2017 21:07:25 +0100
Subject: [PATCH] Let nettle-hash --list display internal context size.

* tools/nettle-hash.c (list_algorithms): Also display the internal
context size.
---
 ChangeLog           | 5 +++++
 tools/nettle-hash.c | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 300c11d9..b67b44d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-20  Niels Möller  <nisse@lysator.liu.se>
+
+	* tools/nettle-hash.c (list_algorithms): Also display the internal
+	context size.
+
 2017-01-03  Nikos Mavrogiannopoulos <nmav@redhat.com>
 
 	* ecdsa-verify.c (ecdsa_verify): Eliminated memory leak on error
diff --git a/tools/nettle-hash.c b/tools/nettle-hash.c
index fc991ee9..488dff3d 100644
--- a/tools/nettle-hash.c
+++ b/tools/nettle-hash.c
@@ -53,11 +53,11 @@ list_algorithms (void)
 {
   unsigned i;
   const struct nettle_hash *alg;
-  printf ("%10s digestsize (internal block size), in units of octets\n", "name");
+  printf ("%10s digestsize (internal block size, context size), in units of octets\n", "name");
 
   for (i = 0; (alg = nettle_hashes[i]); i++)
-    printf ("%10s %d (%d)\n",
-	    alg->name, alg->digest_size, alg->block_size);
+    printf ("%10s %d (%d, %d)\n",
+	    alg->name, alg->digest_size, alg->block_size, alg->context_size);
 };
 
 static const struct nettle_hash *
-- 
GitLab