Lines Matching refs:context

112 	PHP_MD5_CTX context;  in PHP_NAMED_FUNCTION()  local
119 PHP_MD5Init(&context); in PHP_NAMED_FUNCTION()
120 PHP_MD5Update(&context, arg, arg_len); in PHP_NAMED_FUNCTION()
121 PHP_MD5Final(digest, &context); in PHP_NAMED_FUNCTION()
141 PHP_MD5_CTX context; in PHP_NAMED_FUNCTION() local
154 PHP_MD5Init(&context); in PHP_NAMED_FUNCTION()
157 PHP_MD5Update(&context, buf, n); in PHP_NAMED_FUNCTION()
160 PHP_MD5Final(digest, &context); in PHP_NAMED_FUNCTION()
265 PHP_HASH_API void PHP_MD5Init(PHP_MD5_CTX * context) in PHP_MD5Init() argument
267 context->count[0] = context->count[1] = 0; in PHP_MD5Init()
270 context->state[0] = 0x67452301; in PHP_MD5Init()
271 context->state[1] = 0xefcdab89; in PHP_MD5Init()
272 context->state[2] = 0x98badcfe; in PHP_MD5Init()
273 context->state[3] = 0x10325476; in PHP_MD5Init()
282 PHP_HASH_API void PHP_MD5Update(PHP_MD5_CTX * context, const unsigned char *input, in PHP_MD5Update() argument
288 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_MD5Update()
291 if ((context->count[0] += ((uint32_t) inputLen << 3)) in PHP_MD5Update()
293 context->count[1]++; in PHP_MD5Update()
294 context->count[1] += ((uint32_t) inputLen >> 29); in PHP_MD5Update()
302 ((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_MD5Update()
303 MD5Transform(context->state, context->buffer); in PHP_MD5Update()
306 MD5Transform(context->state, &input[i]); in PHP_MD5Update()
314 ((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], in PHP_MD5Update()
323 PHP_HASH_API void PHP_MD5Final(unsigned char digest[16], PHP_MD5_CTX * context) in PHP_MD5Final() argument
329 Encode(bits, context->count, 8); in PHP_MD5Final()
333 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_MD5Final()
335 PHP_MD5Update(context, PADDING, padLen); in PHP_MD5Final()
338 PHP_MD5Update(context, bits, 8); in PHP_MD5Final()
341 Encode(digest, context->state, 16); in PHP_MD5Final()
345 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_MD5Final()
525 PHP_HASH_API void PHP_MD4Init(PHP_MD4_CTX * context) in PHP_MD4Init() argument
527 context->count[0] = context->count[1] = 0; in PHP_MD4Init()
530 context->state[0] = 0x67452301; in PHP_MD4Init()
531 context->state[1] = 0xefcdab89; in PHP_MD4Init()
532 context->state[2] = 0x98badcfe; in PHP_MD4Init()
533 context->state[3] = 0x10325476; in PHP_MD4Init()
542 PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX * context, const unsigned char *input, unsigned int inp… in PHP_MD4Update() argument
547 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_MD4Update()
550 if ((context->count[0] += ((uint32_t) inputLen << 3)) in PHP_MD4Update()
552 context->count[1]++; in PHP_MD4Update()
553 context->count[1] += ((uint32_t) inputLen >> 29); in PHP_MD4Update()
560 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_MD4Update()
561 MD4Transform(context->state, context->buffer); in PHP_MD4Update()
564 MD4Transform(context->state, &input[i]); in PHP_MD4Update()
573 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_MD4Update()
581 PHP_HASH_API void PHP_MD4Final(unsigned char digest[16], PHP_MD4_CTX * context) in PHP_MD4Final() argument
587 Encode(bits, context->count, 8); in PHP_MD4Final()
591 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_MD4Final()
593 PHP_MD4Update(context, PADDING, padLen); in PHP_MD4Final()
596 PHP_MD4Update(context, bits, 8); in PHP_MD4Final()
599 Encode(digest, context->state, 16); in PHP_MD4Final()
603 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_MD4Final()
627 PHP_HASH_API void PHP_MD2Init(PHP_MD2_CTX *context) in PHP_MD2Init() argument
629 memset(context, 0, sizeof(PHP_MD2_CTX)); in PHP_MD2Init()
632 static void MD2_Transform(PHP_MD2_CTX *context, const unsigned char *block) in MD2_Transform() argument
637 context->state[16+i] = block[i]; in MD2_Transform()
638 context->state[32+i] = (context->state[16+i] ^ context->state[i]); in MD2_Transform()
643 t = context->state[j] = context->state[j] ^ MD2_S[t]; in MD2_Transform()
649 t = context->checksum[15]; in MD2_Transform()
651 t = context->checksum[i] ^= MD2_S[block[i] ^ t]; in MD2_Transform()
655 PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, unsigned int len) in PHP_MD2Update() argument
659 if (context->in_buffer) { in PHP_MD2Update()
660 if (context->in_buffer + len < 16) { in PHP_MD2Update()
662 memcpy(context->buffer + context->in_buffer, p, len); in PHP_MD2Update()
663 context->in_buffer += len; in PHP_MD2Update()
667 memcpy(context->buffer + context->in_buffer, p, 16 - context->in_buffer); in PHP_MD2Update()
668 MD2_Transform(context, context->buffer); in PHP_MD2Update()
669 p += 16 - context->in_buffer; in PHP_MD2Update()
670 context->in_buffer = 0; in PHP_MD2Update()
675 MD2_Transform(context, p); in PHP_MD2Update()
681 memcpy(context->buffer, p, e - p); in PHP_MD2Update()
682 context->in_buffer = e - p; in PHP_MD2Update()
686 PHP_HASH_API void PHP_MD2Final(unsigned char output[16], PHP_MD2_CTX *context) in PHP_MD2Final() argument
688 memset(context->buffer + context->in_buffer, 16 - context->in_buffer, 16 - context->in_buffer); in PHP_MD2Final()
689 MD2_Transform(context, context->buffer); in PHP_MD2Final()
690 MD2_Transform(context, context->checksum); in PHP_MD2Final()
692 memcpy(output, context->state, 16); in PHP_MD2Final()