Lines Matching refs:context
112 PHP_MD5_CTX context; in PHP_NAMED_FUNCTION() local
120 PHP_MD5Init(&context); in PHP_NAMED_FUNCTION()
121 PHP_MD5Update(&context, arg, arg_len); in PHP_NAMED_FUNCTION()
122 PHP_MD5Final(digest, &context); in PHP_NAMED_FUNCTION()
143 PHP_MD5_CTX context; in PHP_NAMED_FUNCTION() local
156 PHP_MD5Init(&context); in PHP_NAMED_FUNCTION()
159 PHP_MD5Update(&context, buf, n); in PHP_NAMED_FUNCTION()
162 PHP_MD5Final(digest, &context); in PHP_NAMED_FUNCTION()
267 PHP_HASH_API void PHP_MD5Init(PHP_MD5_CTX * context) in PHP_MD5Init() argument
269 context->count[0] = context->count[1] = 0; in PHP_MD5Init()
272 context->state[0] = 0x67452301; in PHP_MD5Init()
273 context->state[1] = 0xefcdab89; in PHP_MD5Init()
274 context->state[2] = 0x98badcfe; in PHP_MD5Init()
275 context->state[3] = 0x10325476; in PHP_MD5Init()
284 PHP_HASH_API void PHP_MD5Update(PHP_MD5_CTX * context, const unsigned char *input, in PHP_MD5Update() argument
290 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_MD5Update()
293 if ((context->count[0] += ((uint32_t) inputLen << 3)) in PHP_MD5Update()
295 context->count[1]++; in PHP_MD5Update()
296 context->count[1] += ((uint32_t) inputLen >> 29); in PHP_MD5Update()
304 ((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_MD5Update()
305 MD5Transform(context->state, context->buffer); in PHP_MD5Update()
308 MD5Transform(context->state, &input[i]); in PHP_MD5Update()
316 ((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], in PHP_MD5Update()
325 PHP_HASH_API void PHP_MD5Final(unsigned char digest[16], PHP_MD5_CTX * context) in PHP_MD5Final() argument
331 Encode(bits, context->count, 8); in PHP_MD5Final()
335 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_MD5Final()
337 PHP_MD5Update(context, PADDING, padLen); in PHP_MD5Final()
340 PHP_MD5Update(context, bits, 8); in PHP_MD5Final()
343 Encode(digest, context->state, 16); in PHP_MD5Final()
347 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_MD5Final()
527 PHP_HASH_API void PHP_MD4Init(PHP_MD4_CTX * context) in PHP_MD4Init() argument
529 context->count[0] = context->count[1] = 0; in PHP_MD4Init()
532 context->state[0] = 0x67452301; in PHP_MD4Init()
533 context->state[1] = 0xefcdab89; in PHP_MD4Init()
534 context->state[2] = 0x98badcfe; in PHP_MD4Init()
535 context->state[3] = 0x10325476; in PHP_MD4Init()
544 PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX * context, const unsigned char *input, unsigned int inp… in PHP_MD4Update() argument
549 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_MD4Update()
552 if ((context->count[0] += ((uint32_t) inputLen << 3)) in PHP_MD4Update()
554 context->count[1]++; in PHP_MD4Update()
555 context->count[1] += ((uint32_t) inputLen >> 29); in PHP_MD4Update()
562 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_MD4Update()
563 MD4Transform(context->state, context->buffer); in PHP_MD4Update()
566 MD4Transform(context->state, &input[i]); in PHP_MD4Update()
575 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_MD4Update()
583 PHP_HASH_API void PHP_MD4Final(unsigned char digest[16], PHP_MD4_CTX * context) in PHP_MD4Final() argument
589 Encode(bits, context->count, 8); in PHP_MD4Final()
593 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_MD4Final()
595 PHP_MD4Update(context, PADDING, padLen); in PHP_MD4Final()
598 PHP_MD4Update(context, bits, 8); in PHP_MD4Final()
601 Encode(digest, context->state, 16); in PHP_MD4Final()
605 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_MD4Final()
629 PHP_HASH_API void PHP_MD2Init(PHP_MD2_CTX *context) in PHP_MD2Init() argument
631 memset(context, 0, sizeof(PHP_MD2_CTX)); in PHP_MD2Init()
634 static void MD2_Transform(PHP_MD2_CTX *context, const unsigned char *block) in MD2_Transform() argument
639 context->state[16+i] = block[i]; in MD2_Transform()
640 context->state[32+i] = (context->state[16+i] ^ context->state[i]); in MD2_Transform()
645 t = context->state[j] = context->state[j] ^ MD2_S[t]; in MD2_Transform()
651 t = context->checksum[15]; in MD2_Transform()
653 t = context->checksum[i] ^= MD2_S[block[i] ^ t]; in MD2_Transform()
657 PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, unsigned int len) in PHP_MD2Update() argument
661 if (context->in_buffer) { in PHP_MD2Update()
662 if (context->in_buffer + len < 16) { in PHP_MD2Update()
664 memcpy(context->buffer + context->in_buffer, p, len); in PHP_MD2Update()
665 context->in_buffer += len; in PHP_MD2Update()
669 memcpy(context->buffer + context->in_buffer, p, 16 - context->in_buffer); in PHP_MD2Update()
670 MD2_Transform(context, context->buffer); in PHP_MD2Update()
671 p += 16 - context->in_buffer; in PHP_MD2Update()
672 context->in_buffer = 0; in PHP_MD2Update()
677 MD2_Transform(context, p); in PHP_MD2Update()
683 memcpy(context->buffer, p, e - p); in PHP_MD2Update()
684 context->in_buffer = e - p; in PHP_MD2Update()
688 PHP_HASH_API void PHP_MD2Final(unsigned char output[16], PHP_MD2_CTX *context) in PHP_MD2Final() argument
690 memset(context->buffer + context->in_buffer, 16 - context->in_buffer, 16 - context->in_buffer); in PHP_MD2Final()
691 MD2_Transform(context, context->buffer); in PHP_MD2Final()
692 MD2_Transform(context, context->checksum); in PHP_MD2Final()
694 memcpy(output, context->state, 16); in PHP_MD2Final()