summaryrefslogtreecommitdiff
path: root/lib/libc/hash/sha1.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-12-23 04:33:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-12-23 04:33:32 +0000
commit240d00ccd27633050d6be0531a777f845b5b5440 (patch)
tree29cb992a046c08dd2cfb239776fcbb1a8c6be710 /lib/libc/hash/sha1.c
parent29b88a9674bfc30b4c7a4401f9169584b56e571a (diff)
o Ansi function headers
o Add __BEGIN_DECLS/__END_DECLS to include files o Safe macros o Remove useless variable assignment in the End function of *hl.c o Some minor KNF, needs more From Dan Weeks
Diffstat (limited to 'lib/libc/hash/sha1.c')
-rw-r--r--lib/libc/hash/sha1.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/libc/hash/sha1.c b/lib/libc/hash/sha1.c
index 7b11732e925..def87a5b6d9 100644
--- a/lib/libc/hash/sha1.c
+++ b/lib/libc/hash/sha1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sha1.c,v 1.9 1997/07/23 21:12:32 kstailey Exp $ */
+/* $OpenBSD: sha1.c,v 1.10 2002/12/23 04:33:31 millert Exp $ */
/*
* SHA-1 in C
@@ -14,6 +14,10 @@
* 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
*/
+#if defined(LIBC_SCCS) && !defined(lint)
+static char rcsid[] = "$OpenBSD: sha1.c,v 1.10 2002/12/23 04:33:31 millert Exp $";
+#endif /* LIBC_SCCS and not lint */
+
#define SHA1HANDSOFF /* Copies data before messing with it. */
#include <sys/param.h>
@@ -48,9 +52,8 @@
/*
* Hash a single 512-bit block. This is the core of the algorithm.
*/
-void SHA1Transform(state, buffer)
- u_int32_t state[5];
- const u_char buffer[64];
+void
+SHA1Transform(u_int32_t state[5], const u_char buffer[64])
{
u_int32_t a, b, c, d, e;
typedef union {
@@ -111,8 +114,8 @@ void SHA1Transform(state, buffer)
/*
* SHA1Init - Initialize new context
*/
-void SHA1Init(context)
- SHA1_CTX *context;
+void
+SHA1Init(SHA1_CTX *context)
{
/* SHA1 initialization constants */
@@ -128,10 +131,8 @@ void SHA1Init(context)
/*
* Run your data through this.
*/
-void SHA1Update(context, data, len)
- SHA1_CTX *context;
- const u_char *data;
- u_int len;
+void
+SHA1Update(SHA1_CTX *context, const u_char *data, u_int len)
{
u_int i, j;
@@ -155,9 +156,8 @@ void SHA1Update(context, data, len)
/*
* Add padding and return the message digest.
*/
-void SHA1Final(digest, context)
- u_char digest[20];
- SHA1_CTX* context;
+void
+SHA1Final(u_char digest[20], SHA1_CTX *context)
{
u_int i;
u_char finalcount[8];