chiark / gitweb /
cleanup: fix up the types of input to hashes to const void* from const uint8_t*
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Jun 2011 12:48:34 +0000 (13:48 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jun 2011 11:07:27 +0000 (12:07 +0100)
It is permissible to pass any object to these functions and expect
them to hash it.

Signed-off-by: Richard Kettlewell <richard@greenend.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
md5.c
secnet.h
sha1.c

diff --git a/md5.c b/md5.c
index 9a4dcc3795d3c1dfd7b1f58f27368e6ab7bc15c2..2e0b9b8cc48df382ed3f4332f0bef4263a82ac24 100644 (file)
--- a/md5.c
+++ b/md5.c
@@ -247,7 +247,7 @@ static void *md5_init(void)
     return ctx;
 }
 
-static void md5_update(void *sst, uint8_t const *buf, int32_t len)
+static void md5_update(void *sst, const void *buf, int32_t len)
 {
     struct MD5Context *ctx=sst;
 
index 9cc22059ad0272e189a4b54d3b5a505d67b7e71f..b60972fb30fd3cfad9cfe02ee6820cd8fd697ad0 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -438,7 +438,7 @@ struct dh_if {
 /* HASH interface */
 
 typedef void *hash_init_fn(void);
-typedef void hash_update_fn(void *st, uint8_t const *buf, int32_t len);
+typedef void hash_update_fn(void *st, const void *buf, int32_t len);
 typedef void hash_final_fn(void *st, uint8_t *digest);
 struct hash_if {
     int32_t len; /* Hash output length in bytes */
diff --git a/sha1.c b/sha1.c
index 0bcae8798867e8329aa219444970058b3a05faeb..a0f26e8be6facdadfed882d1cf4dd65fd6da9523 100644 (file)
--- a/sha1.c
+++ b/sha1.c
@@ -294,7 +294,7 @@ static void *sha1_init(void)
     return ctx;
 }
 
-static void sha1_update(void *sst, uint8_t const *buf, int32_t len)
+static void sha1_update(void *sst, const void *buf, int32_t len)
 {
     SHA1_CTX *ctx=sst;