projects
/
libradsec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
82c9dd4
)
Constify the MD5 implementation.
author
Linus Nordberg
<linus@nordberg.se>
Wed, 8 May 2013 18:21:18 +0000
(20:21 +0200)
committer
Linus Nordberg
<linus@nordberg.se>
Wed, 8 May 2013 18:21:18 +0000
(20:21 +0200)
lib/md5.c
patch
|
blob
|
history
lib/md5.h
patch
|
blob
|
history
diff --git
a/lib/md5.c
b/lib/md5.c
index
7d43a60
..
f4ac436
100644
(file)
--- a/
lib/md5.c
+++ b/
lib/md5.c
@@
-89,9
+89,9
@@
* This processes one or more 64-byte data blocks, but does NOT update
* the bit counters. There are no alignment requirements.
*/
* This processes one or more 64-byte data blocks, but does NOT update
* the bit counters. There are no alignment requirements.
*/
-static
void *body(MD5_CTX *ctx,
void *data, unsigned long size)
+static
const void *body(MD5_CTX *ctx, const
void *data, unsigned long size)
{
{
- unsigned char *ptr;
+
const
unsigned char *ptr;
MD5_u32plus a, b, c, d;
MD5_u32plus saved_a, saved_b, saved_c, saved_d;
MD5_u32plus a, b, c, d;
MD5_u32plus saved_a, saved_b, saved_c, saved_d;
@@
-207,7
+207,7
@@
void MD5_Init(MD5_CTX *ctx)
ctx->hi = 0;
}
ctx->hi = 0;
}
-void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size)
+void MD5_Update(MD5_CTX *ctx,
const
void *data, unsigned long size)
{
MD5_u32plus saved_lo;
unsigned long used, free;
{
MD5_u32plus saved_lo;
unsigned long used, free;
diff --git
a/lib/md5.h
b/lib/md5.h
index
f1a6857
..
2da44bf
100644
(file)
--- a/
lib/md5.h
+++ b/
lib/md5.h
@@
-39,7
+39,7
@@
typedef struct {
} MD5_CTX;
extern void MD5_Init(MD5_CTX *ctx);
} MD5_CTX;
extern void MD5_Init(MD5_CTX *ctx);
-extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size);
+extern void MD5_Update(MD5_CTX *ctx,
const
void *data, unsigned long size);
extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
#endif
extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
#endif