Lines Matching refs:context
188 PHP_HASH_API void PHP_MD4Init(PHP_MD4_CTX * context) in PHP_MD4Init() argument
190 context->count[0] = context->count[1] = 0; in PHP_MD4Init()
193 context->state[0] = 0x67452301; in PHP_MD4Init()
194 context->state[1] = 0xefcdab89; in PHP_MD4Init()
195 context->state[2] = 0x98badcfe; in PHP_MD4Init()
196 context->state[3] = 0x10325476; in PHP_MD4Init()
205 PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX * context, const unsigned char *input, size_t inputLen) in PHP_MD4Update() argument
210 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_MD4Update()
213 if ((context->count[0] += ((uint32_t) inputLen << 3)) in PHP_MD4Update()
215 context->count[1]++; in PHP_MD4Update()
216 context->count[1] += ((uint32_t) inputLen >> 29); in PHP_MD4Update()
223 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_MD4Update()
224 MD4Transform(context->state, context->buffer); in PHP_MD4Update()
227 MD4Transform(context->state, &input[i]); in PHP_MD4Update()
236 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_MD4Update()
244 PHP_HASH_API void PHP_MD4Final(unsigned char digest[16], PHP_MD4_CTX * context) in PHP_MD4Final() argument
250 Encode(bits, context->count, 8); in PHP_MD4Final()
254 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_MD4Final()
256 PHP_MD4Update(context, PADDING, padLen); in PHP_MD4Final()
259 PHP_MD4Update(context, bits, 8); in PHP_MD4Final()
262 Encode(digest, context->state, 16); in PHP_MD4Final()
266 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_MD4Final()
290 PHP_HASH_API void PHP_MD2Init(PHP_MD2_CTX *context) in PHP_MD2Init() argument
292 memset(context, 0, sizeof(PHP_MD2_CTX)); in PHP_MD2Init()
295 static void MD2_Transform(PHP_MD2_CTX *context, const unsigned char *block) in MD2_Transform() argument
300 context->state[16+i] = block[i]; in MD2_Transform()
301 context->state[32+i] = (context->state[16+i] ^ context->state[i]); in MD2_Transform()
306 t = context->state[j] = context->state[j] ^ MD2_S[t]; in MD2_Transform()
312 t = context->checksum[15]; in MD2_Transform()
314 t = context->checksum[i] ^= MD2_S[block[i] ^ t]; in MD2_Transform()
318 PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, size_t len) in PHP_MD2Update() argument
322 if (context->in_buffer) { in PHP_MD2Update()
323 if (context->in_buffer + len < 16) { in PHP_MD2Update()
325 memcpy(context->buffer + context->in_buffer, p, len); in PHP_MD2Update()
326 context->in_buffer += (char) len; in PHP_MD2Update()
330 memcpy(context->buffer + context->in_buffer, p, 16 - context->in_buffer); in PHP_MD2Update()
331 MD2_Transform(context, context->buffer); in PHP_MD2Update()
332 p += 16 - context->in_buffer; in PHP_MD2Update()
333 context->in_buffer = 0; in PHP_MD2Update()
338 MD2_Transform(context, p); in PHP_MD2Update()
344 memcpy(context->buffer, p, e - p); in PHP_MD2Update()
345 context->in_buffer = (char) (e - p); in PHP_MD2Update()
349 PHP_HASH_API void PHP_MD2Final(unsigned char output[16], PHP_MD2_CTX *context) in PHP_MD2Final() argument
351 memset(context->buffer + context->in_buffer, 16 - context->in_buffer, 16 - context->in_buffer); in PHP_MD2Final()
352 MD2_Transform(context, context->buffer); in PHP_MD2Final()
353 MD2_Transform(context, context->checksum); in PHP_MD2Final()
355 memcpy(output, context->state, 16); in PHP_MD2Final()
360 PHP_MD2_CTX *ctx = (PHP_MD2_CTX *) hash->context; in php_md2_unserialize()