From bb870345245aa764e061e7d0c9cbc0a922eabf58 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Tue, 10 Mar 2009 12:22:55 +0000 Subject: [PATCH] Remove const warnings in crypto.c. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1826 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/crypto.c | 8 ++++---- exec/crypto.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/exec/crypto.c b/exec/crypto.c index e943bc4a..6c6783ea 100644 --- a/exec/crypto.c +++ b/exec/crypto.c @@ -682,7 +682,7 @@ const struct _prng_descriptor *prng_descriptor[] = { #define B(x,i) ((unsigned char)(((x) >> (8*i)) & 0xFF)) -static ulong32 BYTE2WORD(unsigned char *b) +static ulong32 BYTE2WORD(const unsigned char *b) { ulong32 t; LOAD32L(t, b); @@ -845,7 +845,7 @@ int sober128_add_entropy(const unsigned char *buf, unsigned long len, prng_state assert ((len & 3) == 0); for (i = 0; i < len; i += 4) { - k = BYTE2WORD((unsigned char*)&buf[i]); + k = BYTE2WORD(&buf[i]); ADDKEY(k); cycle(c->R); XORNL(nltap(c)); @@ -870,7 +870,7 @@ int sober128_add_entropy(const unsigned char *buf, unsigned long len, prng_state assert ((len & 3) == 0); for (i = 0; i < len; i += 4) { - k = BYTE2WORD((unsigned char *)&buf[i]); + k = BYTE2WORD(&buf[i]); ADDKEY(k); cycle(c->R); XORNL(nltap(c)); @@ -987,7 +987,7 @@ const struct _hash_descriptor sha1_desc = #define F2(x,y,z) ((x & y) | (z & (x | y))) #define F3(x,y,z) (x ^ y ^ z) -static void sha1_compress(hash_state *md, unsigned char *buf) +static void sha1_compress(hash_state *md, const unsigned char *buf) { ulong32 a,b,c,d,e,W[80],i; diff --git a/exec/crypto.h b/exec/crypto.h index 0f475e68..427dc16a 100644 --- a/exec/crypto.h +++ b/exec/crypto.h @@ -52,7 +52,7 @@ typedef union Hash_state { } hash_state; struct _hash_descriptor { - char *name; + const char *name; unsigned char ID; unsigned long hashsize; /* digest output size in bytes */ unsigned long blocksize; /* the block size the hash uses */ @@ -106,7 +106,7 @@ typedef union Prng_state { } prng_state; struct _prng_descriptor { - char *name; + const char *name; int export_size; /* size in bytes of exported state */ int (*start)(prng_state *); int (*add_entropy)(const unsigned char *, unsigned long, prng_state *);