summaryrefslogtreecommitdiff
path: root/lib/md5.c
diff options
context:
space:
mode:
authorpaul <paul>2005-05-06 21:25:49 +0000
committerpaul <paul>2005-05-06 21:25:49 +0000
commit8cc4198f9fabe5f10f5a773de1503d82f33a01fb (patch)
tree77045da709ff66629bd12029b9ee17700360909b /lib/md5.c
parente7fe8c88c3d552400e1ae3ae9243319ab95d6f2d (diff)
2005-05-06 Paul Jakma <paul@dishone.st>
* (general) extern and static'ification of functions in code and header. Cleanup any definitions with unspecified arguments. Add casts for callback assignments where the callback is defined, typically, as passing void *, but the function being assigned has some other pointer type defined as its argument, as gcc complains about casts from void * to X* via function arguments. Fix some old K&R style function argument definitions. Add noreturn gcc attribute to some functions, as appropriate. Add unused gcc attribute to some functions (eg ones meant to help while debugging) Add guard defines to headers which were missing them. * command.c: (install_node) add const qualifier, still doesnt shut up the warning though, because of the double pointer. (cmp_node) ditto * keychain.c: (key_str2time) Add GET_LONG_RANGE() macro, derived fromn vty.h ones to fix some of the (long) < 0 warnings. * thread.c: (various) use thread_empty (cpu_record_hash_key) should cast to uintptr_t, a stdint.h type * vty.h: Add VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX so they removed from ospfd/ospf_vty.h * zebra.h: Move definition of ZEBRA_PORT to here, to remove dependence of lib on zebra/zserv.h
Diffstat (limited to 'lib/md5.c')
-rw-r--r--lib/md5.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/lib/md5.c b/lib/md5.c
index 2068c46d..c6b7ca52 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -69,8 +69,7 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
/* Initialize structure containing state of computation.
(RFC 1321, 3.3: Step 3) */
void
-md5_init_ctx (ctx)
- struct md5_ctx *ctx;
+md5_init_ctx (struct md5_ctx *ctx)
{
ctx->A = 0x67452301;
ctx->B = 0xefcdab89;
@@ -87,9 +86,7 @@ md5_init_ctx (ctx)
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
void *
-md5_read_ctx (ctx, resbuf)
- const struct md5_ctx *ctx;
- void *resbuf;
+md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
{
((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
@@ -105,9 +102,7 @@ md5_read_ctx (ctx, resbuf)
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
void *
-md5_finish_ctx (ctx, resbuf)
- struct md5_ctx *ctx;
- void *resbuf;
+md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
{
/* Take yet unprocessed bytes into account. */
md5_uint32 bytes = ctx->buflen;
@@ -136,9 +131,7 @@ md5_finish_ctx (ctx, resbuf)
resulting message digest number will be written into the 16 bytes
beginning at RESBLOCK. */
int
-md5_stream (stream, resblock)
- FILE *stream;
- void *resblock;
+md5_stream (FILE *stream, void *resblock)
{
/* Important: BLOCKSIZE must be a multiple of 64. */
#define BLOCKSIZE 4096
@@ -193,10 +186,7 @@ md5_stream (stream, resblock)
output yields to the wanted ASCII representation of the message
digest. */
void *
-md5_buffer (buffer, len, resblock)
- const char *buffer;
- size_t len;
- void *resblock;
+md5_buffer (const char *buffer, size_t len, void *resblock)
{
struct md5_ctx ctx;
@@ -212,10 +202,7 @@ md5_buffer (buffer, len, resblock)
void
-md5_process_bytes (buffer, len, ctx)
- const void *buffer;
- size_t len;
- struct md5_ctx *ctx;
+md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
{
/* When we already have some bits in our internal buffer concatenate
both inputs first. */
@@ -270,10 +257,7 @@ md5_process_bytes (buffer, len, ctx)
It is assumed that LEN % 64 == 0. */
void
-md5_process_block (buffer, len, ctx)
- const void *buffer;
- size_t len;
- struct md5_ctx *ctx;
+md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
{
md5_uint32 correct_words[16];
const md5_uint32 *words = buffer;