Commit 1ee3b153 authored by Brian Wellington's avatar Brian Wellington
Browse files

Added length constants, changed _final parameter from array to pointer.

parent fbb2ab30
......@@ -42,6 +42,8 @@
#include <isc/types.h>
#define ISC_MD5_DIGESTLENGTH 16
typedef struct {
isc_uint32_t buf[4];
isc_uint32_t bytes[2];
......@@ -52,6 +54,6 @@ void isc_md5_init(isc_md5_t *ctx);
void isc_md5_invalidate(isc_md5_t *ctx);
void isc_md5_update(isc_md5_t *ctx, const unsigned char *buf,
unsigned int len);
void isc_md5_final(isc_md5_t *ctx, unsigned char digest[16]);
void isc_md5_final(isc_md5_t *ctx, unsigned char *digest);
#endif /* !MD5_H */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: sha1.h,v 1.3 2000/06/07 00:30:42 explorer Exp $ */
/* $Id: sha1.h,v 1.4 2000/06/07 02:28:43 bwelling Exp $ */
/* $NetBSD: sha1.h,v 1.2 1998/05/29 22:55:44 thorpej Exp $ */
......@@ -30,6 +30,8 @@
#include <isc/types.h>
#define ISC_SHA1_DIGESTLENGTH 20
typedef struct {
isc_uint32_t state[5];
isc_uint32_t count[2];
......@@ -40,6 +42,6 @@ void isc_sha1_init(isc_sha1_t *ctx);
void isc_sha1_invalidate(isc_sha1_t *ctx);
void isc_sha1_update(isc_sha1_t *ctx, const unsigned char *data,
unsigned int len);
void isc_sha1_final(isc_sha1_t *ctx, unsigned char digest[20]);
void isc_sha1_final(isc_sha1_t *ctx, unsigned char *digest);
#endif /* ISC_SHA1_H */
......@@ -216,7 +216,7 @@ isc_md5_update(isc_md5_t *ctx, const unsigned char *buf, unsigned int len) {
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void
isc_md5_final(isc_md5_t *ctx, unsigned char digest[16]) {
isc_md5_final(isc_md5_t *ctx, unsigned char *digest) {
int count = ctx->bytes[0] & 0x3f; /* Number of bytes in ctx->in */
unsigned char *p = (unsigned char *)ctx->in + count;
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: sha1.c,v 1.4 2000/06/07 01:14:26 explorer Exp $ */
/* $Id: sha1.c,v 1.5 2000/06/07 02:28:40 bwelling Exp $ */
/* $NetBSD: sha1.c,v 1.5 2000/01/22 22:19:14 mycroft Exp $ */
/* $OpenBSD: sha1.c,v 1.9 1997/07/23 21:12:32 kstailey Exp $ */
......@@ -224,7 +224,7 @@ static const unsigned char final_200 = '\200';
static const unsigned char final_0 = '\0';
void
isc_sha1_final(isc_sha1_t *context, unsigned char digest[20]) {
isc_sha1_final(isc_sha1_t *context, unsigned char *digest) {
unsigned int i;
unsigned char finalcount[8];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment