aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/sha1/sha1.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-01-02 10:19:52 -0800
committerGarrett D'Amore <garrett@damore.org>2018-01-02 10:19:52 -0800
commitdc08fbe8abfbaa16390cdfd360be9d74f0a28576 (patch)
treea8772e8f0723b77a1d4a9c09e04283841aebe152 /src/supplemental/sha1/sha1.c
parent1e945e873d3bd791354dec504e42025502c6042f (diff)
downloadnng-dc08fbe8abfbaa16390cdfd360be9d74f0a28576.tar.gz
nng-dc08fbe8abfbaa16390cdfd360be9d74f0a28576.tar.bz2
nng-dc08fbe8abfbaa16390cdfd360be9d74f0a28576.zip
SHA1 should just use void * for message pointers in API.
Diffstat (limited to 'src/supplemental/sha1/sha1.c')
-rw-r--r--src/supplemental/sha1/sha1.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/supplemental/sha1/sha1.c b/src/supplemental/sha1/sha1.c
index 39a98e07..228b497d 100644
--- a/src/supplemental/sha1/sha1.c
+++ b/src/supplemental/sha1/sha1.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -86,7 +86,7 @@ nni_sha1_final(nni_sha1_ctx *ctx, uint8_t digest[20])
// nni_sha1 is a convenience that does the entire init, update, and final
// sequence in a single operation.
void
-nni_sha1(const uint8_t *msg, size_t length, uint8_t digest[20])
+nni_sha1(const void *msg, size_t length, uint8_t digest[20])
{
nni_sha1_ctx ctx;
@@ -97,8 +97,10 @@ nni_sha1(const uint8_t *msg, size_t length, uint8_t digest[20])
// nni_sha1_update updates the SHA1 context, reading from the message supplied.
void
-nni_sha1_update(nni_sha1_ctx *ctx, const uint8_t *msg, size_t length)
+nni_sha1_update(nni_sha1_ctx *ctx, const void *data, size_t length)
{
+ const uint8_t *msg = data;
+
if (!length) {
return;
}