Lines Matching refs:context
256 PHP_HASH_API void PHP_##p##HAVAL##b##Init(PHP_HAVAL_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *…
257 { int i; context->count[0] = context->count[1] = 0; \
258 for(i = 0; i < 8; i++) context->state[i] = D0[i]; \
259 context->passes = p; context->output = b; \
260 context->Transform = PHP_##p##HAVALTransform; }
281 PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *context, const unsigned char *input, size_t inputL… in PHP_HAVALUpdate() argument
287 index = (unsigned int) ((context->count[0] >> 3) & 0x7F); in PHP_HAVALUpdate()
289 if ((context->count[0] += ((uint32_t) inputLen << 3)) < ((uint32_t) inputLen << 3)) { in PHP_HAVALUpdate()
290 context->count[1]++; in PHP_HAVALUpdate()
292 context->count[1] += (uint32_t) (inputLen >> 29); in PHP_HAVALUpdate()
299 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_HAVALUpdate()
300 context->Transform(context->state, context->buffer); in PHP_HAVALUpdate()
303 context->Transform(context->state, &input[i]); in PHP_HAVALUpdate()
312 memcpy((unsigned char*) &context->buffer[index], (unsigned char*) &input[i], inputLen - i); in PHP_HAVALUpdate()
319 PHP_HASH_API void PHP_HAVAL128Final(unsigned char *digest, PHP_HAVAL_CTX * context) in PHP_HAVAL128Final() argument
326 ((context->passes & 0x07) << 3) | in PHP_HAVAL128Final()
327 ((context->output & 0x03) << 6); in PHP_HAVAL128Final()
328 bits[1] = (context->output >> 2); in PHP_HAVAL128Final()
331 Encode(bits + 2, context->count, 8); in PHP_HAVAL128Final()
335 index = (unsigned int) ((context->count[0] >> 3) & 0x7f); in PHP_HAVAL128Final()
337 PHP_HAVALUpdate(context, PADDING, padLen); in PHP_HAVAL128Final()
340 PHP_HAVALUpdate(context, bits, 10); in PHP_HAVAL128Final()
343 context->state[3] += (context->state[7] & 0xFF000000) | in PHP_HAVAL128Final()
344 (context->state[6] & 0x00FF0000) | in PHP_HAVAL128Final()
345 (context->state[5] & 0x0000FF00) | in PHP_HAVAL128Final()
346 (context->state[4] & 0x000000FF); in PHP_HAVAL128Final()
348 context->state[2] += (((context->state[7] & 0x00FF0000) | in PHP_HAVAL128Final()
349 (context->state[6] & 0x0000FF00) | in PHP_HAVAL128Final()
350 (context->state[5] & 0x000000FF)) << 8) | in PHP_HAVAL128Final()
351 ((context->state[4] & 0xFF000000) >> 24); in PHP_HAVAL128Final()
353 context->state[1] += (((context->state[7] & 0x0000FF00) | in PHP_HAVAL128Final()
354 (context->state[6] & 0x000000FF)) << 16) | in PHP_HAVAL128Final()
355 (((context->state[5] & 0xFF000000) | in PHP_HAVAL128Final()
356 (context->state[4] & 0x00FF0000)) >> 16); in PHP_HAVAL128Final()
358 context->state[0] += ((context->state[7] & 0x000000FF) << 24) | in PHP_HAVAL128Final()
359 (((context->state[6] & 0xFF000000) | in PHP_HAVAL128Final()
360 (context->state[5] & 0x00FF0000) | in PHP_HAVAL128Final()
361 (context->state[4] & 0x0000FF00)) >> 8); in PHP_HAVAL128Final()
363 Encode(digest, context->state, 16); in PHP_HAVAL128Final()
367 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_HAVAL128Final()
372 PHP_HASH_API void PHP_HAVAL160Final(unsigned char *digest, PHP_HAVAL_CTX * context) in PHP_HAVAL160Final() argument
379 ((context->passes & 0x07) << 3) | in PHP_HAVAL160Final()
380 ((context->output & 0x03) << 6); in PHP_HAVAL160Final()
381 bits[1] = (context->output >> 2); in PHP_HAVAL160Final()
384 Encode(bits + 2, context->count, 8); in PHP_HAVAL160Final()
388 index = (unsigned int) ((context->count[0] >> 3) & 0x7f); in PHP_HAVAL160Final()
390 PHP_HAVALUpdate(context, PADDING, padLen); in PHP_HAVAL160Final()
393 PHP_HAVALUpdate(context, bits, 10); in PHP_HAVAL160Final()
396 context->state[4] += ((context->state[7] & 0xFE000000) | in PHP_HAVAL160Final()
397 (context->state[6] & 0x01F80000) | in PHP_HAVAL160Final()
398 (context->state[5] & 0x0007F000)) >> 12; in PHP_HAVAL160Final()
400 context->state[3] += ((context->state[7] & 0x01F80000) | in PHP_HAVAL160Final()
401 (context->state[6] & 0x0007F000) | in PHP_HAVAL160Final()
402 (context->state[5] & 0x00000FC0)) >> 6; in PHP_HAVAL160Final()
404 context->state[2] += (context->state[7] & 0x0007F000) | in PHP_HAVAL160Final()
405 (context->state[6] & 0x00000FC0) | in PHP_HAVAL160Final()
406 (context->state[5] & 0x0000003F); in PHP_HAVAL160Final()
408 context->state[1] += ROTR((context->state[7] & 0x00000FC0) | in PHP_HAVAL160Final()
409 (context->state[6] & 0x0000003F) | in PHP_HAVAL160Final()
410 (context->state[5] & 0xFE000000), 25); in PHP_HAVAL160Final()
412 context->state[0] += ROTR((context->state[7] & 0x0000003F) | in PHP_HAVAL160Final()
413 (context->state[6] & 0xFE000000) | in PHP_HAVAL160Final()
414 (context->state[5] & 0x01F80000), 19); in PHP_HAVAL160Final()
416 Encode(digest, context->state, 20); in PHP_HAVAL160Final()
420 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_HAVAL160Final()
425 PHP_HASH_API void PHP_HAVAL192Final(unsigned char *digest, PHP_HAVAL_CTX * context) in PHP_HAVAL192Final() argument
432 ((context->passes & 0x07) << 3) | in PHP_HAVAL192Final()
433 ((context->output & 0x03) << 6); in PHP_HAVAL192Final()
434 bits[1] = (context->output >> 2); in PHP_HAVAL192Final()
437 Encode(bits + 2, context->count, 8); in PHP_HAVAL192Final()
441 index = (unsigned int) ((context->count[0] >> 3) & 0x7f); in PHP_HAVAL192Final()
443 PHP_HAVALUpdate(context, PADDING, padLen); in PHP_HAVAL192Final()
446 PHP_HAVALUpdate(context, bits, 10); in PHP_HAVAL192Final()
449 context->state[5] += ((context->state[7] & 0xFC000000) | (context->state[6] & 0x03E00000)) >> 21; in PHP_HAVAL192Final()
450 context->state[4] += ((context->state[7] & 0x03E00000) | (context->state[6] & 0x001F0000)) >> 16; in PHP_HAVAL192Final()
451 context->state[3] += ((context->state[7] & 0x001F0000) | (context->state[6] & 0x0000FC00)) >> 10; in PHP_HAVAL192Final()
452 context->state[2] += ((context->state[7] & 0x0000FC00) | (context->state[6] & 0x000003E0)) >> 5; in PHP_HAVAL192Final()
453 context->state[1] += (context->state[7] & 0x000003E0) | (context->state[6] & 0x0000001F); in PHP_HAVAL192Final()
454 context->state[0] += ROTR((context->state[7] & 0x0000001F) | (context->state[6] & 0xFC000000), 26); in PHP_HAVAL192Final()
455 Encode(digest, context->state, 24); in PHP_HAVAL192Final()
459 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_HAVAL192Final()
464 PHP_HASH_API void PHP_HAVAL224Final(unsigned char *digest, PHP_HAVAL_CTX * context) in PHP_HAVAL224Final() argument
471 ((context->passes & 0x07) << 3) | in PHP_HAVAL224Final()
472 ((context->output & 0x03) << 6); in PHP_HAVAL224Final()
473 bits[1] = (context->output >> 2); in PHP_HAVAL224Final()
476 Encode(bits + 2, context->count, 8); in PHP_HAVAL224Final()
480 index = (unsigned int) ((context->count[0] >> 3) & 0x7f); in PHP_HAVAL224Final()
482 PHP_HAVALUpdate(context, PADDING, padLen); in PHP_HAVAL224Final()
485 PHP_HAVALUpdate(context, bits, 10); in PHP_HAVAL224Final()
488 context->state[6] += context->state[7] & 0x0000000F; in PHP_HAVAL224Final()
489 context->state[5] += (context->state[7] >> 4) & 0x0000001F; in PHP_HAVAL224Final()
490 context->state[4] += (context->state[7] >> 9) & 0x0000000F; in PHP_HAVAL224Final()
491 context->state[3] += (context->state[7] >> 13) & 0x0000001F; in PHP_HAVAL224Final()
492 context->state[2] += (context->state[7] >> 18) & 0x0000000F; in PHP_HAVAL224Final()
493 context->state[1] += (context->state[7] >> 22) & 0x0000001F; in PHP_HAVAL224Final()
494 context->state[0] += (context->state[7] >> 27) & 0x0000001F; in PHP_HAVAL224Final()
495 Encode(digest, context->state, 28); in PHP_HAVAL224Final()
499 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_HAVAL224Final()
504 PHP_HASH_API void PHP_HAVAL256Final(unsigned char *digest, PHP_HAVAL_CTX * context) in PHP_HAVAL256Final() argument
511 ((context->passes & 0x07) << 3) | in PHP_HAVAL256Final()
512 ((context->output & 0x03) << 6); in PHP_HAVAL256Final()
513 bits[1] = (context->output >> 2); in PHP_HAVAL256Final()
516 Encode(bits + 2, context->count, 8); in PHP_HAVAL256Final()
520 index = (unsigned int) ((context->count[0] >> 3) & 0x7f); in PHP_HAVAL256Final()
522 PHP_HAVALUpdate(context, PADDING, padLen); in PHP_HAVAL256Final()
525 PHP_HAVALUpdate(context, bits, 10); in PHP_HAVAL256Final()
528 Encode(digest, context->state, 32); in PHP_HAVAL256Final()
532 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_HAVAL256Final()