Lines Matching refs:context
188 PHP_HASH_API void PHP_MD4InitArgs(PHP_MD4_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable *args) in PHP_MD4InitArgs() argument
190 context->count[0] = context->count[1] = 0; in PHP_MD4InitArgs()
193 context->state[0] = 0x67452301; in PHP_MD4InitArgs()
194 context->state[1] = 0xefcdab89; in PHP_MD4InitArgs()
195 context->state[2] = 0x98badcfe; in PHP_MD4InitArgs()
196 context->state[3] = 0x10325476; in PHP_MD4InitArgs()
205 PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX * context, const unsigned char *input, size_t inputLen) in PHP_MD4Update() argument
211 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_MD4Update()
214 if ((context->count[0] += ((uint32_t) inputLen << 3)) in PHP_MD4Update()
216 context->count[1]++; in PHP_MD4Update()
217 context->count[1] += (uint32_t) (inputLen >> 29); in PHP_MD4Update()
224 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_MD4Update()
225 MD4Transform(context->state, context->buffer); in PHP_MD4Update()
228 MD4Transform(context->state, &input[i]); in PHP_MD4Update()
237 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_MD4Update()
245 PHP_HASH_API void PHP_MD4Final(unsigned char digest[16], PHP_MD4_CTX * context) in PHP_MD4Final() argument
251 Encode(bits, context->count, 8); in PHP_MD4Final()
255 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_MD4Final()
257 PHP_MD4Update(context, PADDING, padLen); in PHP_MD4Final()
260 PHP_MD4Update(context, bits, 8); in PHP_MD4Final()
263 Encode(digest, context->state, 16); in PHP_MD4Final()
267 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_MD4Final()
291 PHP_HASH_API void PHP_MD2InitArgs(PHP_MD2_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args) in PHP_MD2InitArgs() argument
293 memset(context, 0, sizeof(PHP_MD2_CTX)); in PHP_MD2InitArgs()
296 static void MD2_Transform(PHP_MD2_CTX *context, const unsigned char *block) in MD2_Transform() argument
301 context->state[16+i] = block[i]; in MD2_Transform()
302 context->state[32+i] = (context->state[16+i] ^ context->state[i]); in MD2_Transform()
307 t = context->state[j] = context->state[j] ^ MD2_S[t]; in MD2_Transform()
313 t = context->checksum[15]; in MD2_Transform()
315 t = context->checksum[i] ^= MD2_S[block[i] ^ t]; in MD2_Transform()
319 PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, size_t len) in PHP_MD2Update() argument
323 if (context->in_buffer) { in PHP_MD2Update()
324 if (context->in_buffer + len < 16) { in PHP_MD2Update()
326 memcpy(context->buffer + context->in_buffer, p, len); in PHP_MD2Update()
327 context->in_buffer += (char) len; in PHP_MD2Update()
331 memcpy(context->buffer + context->in_buffer, p, 16 - context->in_buffer); in PHP_MD2Update()
332 MD2_Transform(context, context->buffer); in PHP_MD2Update()
333 p += 16 - context->in_buffer; in PHP_MD2Update()
334 context->in_buffer = 0; in PHP_MD2Update()
339 MD2_Transform(context, p); in PHP_MD2Update()
345 memcpy(context->buffer, p, e - p); in PHP_MD2Update()
346 context->in_buffer = (char) (e - p); in PHP_MD2Update()
350 PHP_HASH_API void PHP_MD2Final(unsigned char output[16], PHP_MD2_CTX *context) in PHP_MD2Final() argument
352 memset(context->buffer + context->in_buffer, 16 - context->in_buffer, 16 - context->in_buffer); in PHP_MD2Final()
353 MD2_Transform(context, context->buffer); in PHP_MD2Final()
354 MD2_Transform(context, context->checksum); in PHP_MD2Final()
356 memcpy(output, context->state, 16); in PHP_MD2Final()
361 PHP_MD2_CTX *ctx = (PHP_MD2_CTX *) hash->context; in php_md2_unserialize()