bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sha1 digest size define


From: Simon Josefsson
Subject: sha1 digest size define
Date: Thu, 31 Jan 2008 13:41:42 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

Jim, I noticed that sha1.h is missing a SHA1_DIGEST_SIZE #define, which
can be useful in code using the sha1 package (such as the self test in
the previous post..).  md2, md4 and md5 have similar defines.  What do
you think about adding it to sha1.h?  I.e.:

2008-01-31  Simon Josefsson  <address@hidden>

        * lib/sha1.h (SHA1_DIGEST_SIZE): Add.

diff --git a/lib/sha1.h b/lib/sha1.h
index 9e55974..4ffda7a 100644
--- a/lib/sha1.h
+++ b/lib/sha1.h
@@ -23,6 +23,8 @@
 # include <stdio.h>
 # include <stdint.h>
 
+#define SHA1_DIGEST_SIZE 20
+
 /* Structure to save state of computation between the single steps.  */
 struct sha1_ctx
 {

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]