md5c.c (115872) | md5c.c (154479) |
---|---|
1/* 2 * MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm 3 * 4 * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 5 * rights reserved. 6 * 7 * License to copy and use this software is granted provided that it 8 * is identified as the "RSA Data Security, Inc. MD5 Message-Digest --- 13 unchanged lines hidden (view full) --- 22 * These notices must be retained in any copies of any part of this 23 * documentation and/or software. 24 * 25 * This code is the same as the code published by RSA Inc. It has been 26 * edited for clarity and style only. 27 */ 28 29#include <sys/cdefs.h> | 1/* 2 * MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm 3 * 4 * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 5 * rights reserved. 6 * 7 * License to copy and use this software is granted provided that it 8 * is identified as the "RSA Data Security, Inc. MD5 Message-Digest --- 13 unchanged lines hidden (view full) --- 22 * These notices must be retained in any copies of any part of this 23 * documentation and/or software. 24 * 25 * This code is the same as the code published by RSA Inc. It has been 26 * edited for clarity and style only. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/lib/libmd/md5c.c 115872 2003-06-05 13:17:32Z markm $"); | 30__FBSDID("$FreeBSD: head/lib/libmd/md5c.c 154479 2006-01-17 15:35:57Z phk $"); |
31 32#include <sys/types.h> 33 34#ifdef _KERNEL 35#include <sys/systm.h> 36#else 37#include <string.h> 38#endif --- 103 unchanged lines hidden (view full) --- 142 143/* 144 * MD5 block update operation. Continues an MD5 message-digest 145 * operation, processing another message block, and updating the 146 * context. 147 */ 148 149void | 31 32#include <sys/types.h> 33 34#ifdef _KERNEL 35#include <sys/systm.h> 36#else 37#include <string.h> 38#endif --- 103 unchanged lines hidden (view full) --- 142 143/* 144 * MD5 block update operation. Continues an MD5 message-digest 145 * operation, processing another message block, and updating the 146 * context. 147 */ 148 149void |
150MD5Update (context, input, inputLen) | 150MD5Update (context, in, inputLen) |
151 MD5_CTX *context; | 151 MD5_CTX *context; |
152 const unsigned char *input; | 152 const void *in; |
153 unsigned int inputLen; 154{ 155 unsigned int i, idx, partLen; | 153 unsigned int inputLen; 154{ 155 unsigned int i, idx, partLen; |
156 const unsigned char *input = in; |
|
156 157 /* Compute number of bytes mod 64 */ 158 idx = (unsigned int)((context->count[0] >> 3) & 0x3F); 159 160 /* Update number of bits */ 161 if ((context->count[0] += ((u_int32_t)inputLen << 3)) 162 < ((u_int32_t)inputLen << 3)) 163 context->count[1]++; --- 173 unchanged lines hidden --- | 157 158 /* Compute number of bytes mod 64 */ 159 idx = (unsigned int)((context->count[0] >> 3) & 0x3F); 160 161 /* Update number of bits */ 162 if ((context->count[0] += ((u_int32_t)inputLen << 3)) 163 < ((u_int32_t)inputLen << 3)) 164 context->count[1]++; --- 173 unchanged lines hidden --- |