MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / MD5Update

Function MD5Update

md5.c:128–163  ·  view source on GitHub ↗

MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context. MD5_CTX *context - context unsigned char *input - input block unsigned int inputLen - length of input block */

Source from the content-addressed store, hash-verified

126 unsigned int inputLen - length of input block
127 */
128void MD5Update (MD5_CTX *context, const char *input, unsigned int inputLen)
129{
130 unsigned int i, index, partLen;
131
132 /* Compute number of bytes mod 64 */
133 index = (unsigned int)((context->count[0] >> 3) & 0x3F);
134
135 /* Update number of bits */
136 if ((context->count[0] += ((UINT4)inputLen << 3))
137
138 < ((UINT4)inputLen << 3))
139 context->count[1]++;
140 context->count[1] += ((UINT4)inputLen >> 29);
141
142 partLen = 64 - index;
143
144 /* Transform as many times as possible.
145*/
146 if (inputLen >= partLen) {
147 MD5_memcpy
148 ((POINTER)&context->buffer[index], (POINTER)input, partLen);
149 MD5Transform (context->state, context->buffer);
150
151 for (i = partLen; i + 63 < inputLen; i += 64)
152 MD5Transform (context->state, (const unsigned char *)(&input[i]));
153
154 index = 0;
155 }
156 else
157 i = 0;
158
159 /* Buffer remaining input */
160 MD5_memcpy
161 ((POINTER)&context->buffer[index], (POINTER)&input[i],
162 inputLen-i);
163}
164
165/* MD5 finalization. Ends an MD5 message-digest operation, writing the
166 the message digest and zeroizing the context.

Callers 12

MD5FinalFunction · 0.85
MD5StringArrayFunction · 0.85
MD5FileFunction · 0.85
compute_md5Function · 0.85
hash_ruleFunction · 0.85
hash_dstFunction · 0.85
hash_carrierFunction · 0.85
hash_ruleFunction · 0.85
digest_calc_HA1Function · 0.85
digest_calc_HA1sessFunction · 0.85
digest_calc_HA2Function · 0.85
_digest_calc_responseFunction · 0.85

Calls 2

MD5_memcpyFunction · 0.85
MD5TransformFunction · 0.85

Tested by

no test coverage detected