@@ -336,7 +336,7 @@ PHP_HASH_API void PHP_HAVAL128Final(unsigned char *digest, PHP_HAVAL_CTX * conte
336
336
337
337
/* Pad out to 118 mod 128.
338
338
*/
339
- index = (unsigned int ) ((context -> count [0 ] >> 3 ) & 0x3f );
339
+ index = (unsigned int ) ((context -> count [0 ] >> 3 ) & 0x7f );
340
340
padLen = (index < 118 ) ? (118 - index ) : (246 - index );
341
341
PHP_HAVALUpdate (context , PADDING , padLen );
342
342
@@ -390,7 +390,7 @@ PHP_HASH_API void PHP_HAVAL160Final(unsigned char *digest, PHP_HAVAL_CTX * conte
390
390
391
391
/* Pad out to 118 mod 128.
392
392
*/
393
- index = (unsigned int ) ((context -> count [0 ] >> 3 ) & 0x3f );
393
+ index = (unsigned int ) ((context -> count [0 ] >> 3 ) & 0x7f );
394
394
padLen = (index < 118 ) ? (118 - index ) : (246 - index );
395
395
PHP_HAVALUpdate (context , PADDING , padLen );
396
396
@@ -444,7 +444,7 @@ PHP_HASH_API void PHP_HAVAL192Final(unsigned char *digest, PHP_HAVAL_CTX * conte
444
444
445
445
/* Pad out to 118 mod 128.
446
446
*/
447
- index = (unsigned int ) ((context -> count [0 ] >> 3 ) & 0x3f );
447
+ index = (unsigned int ) ((context -> count [0 ] >> 3 ) & 0x7f );
448
448
padLen = (index < 118 ) ? (118 - index ) : (246 - index );
449
449
PHP_HAVALUpdate (context , PADDING , padLen );
450
450
@@ -484,7 +484,7 @@ PHP_HASH_API void PHP_HAVAL224Final(unsigned char *digest, PHP_HAVAL_CTX * conte
484
484
485
485
/* Pad out to 118 mod 128.
486
486
*/
487
- index = (unsigned int ) ((context -> count [0 ] >> 3 ) & 0x3f );
487
+ index = (unsigned int ) ((context -> count [0 ] >> 3 ) & 0x7f );
488
488
padLen = (index < 118 ) ? (118 - index ) : (246 - index );
489
489
PHP_HAVALUpdate (context , PADDING , padLen );
490
490
@@ -525,7 +525,7 @@ PHP_HASH_API void PHP_HAVAL256Final(unsigned char *digest, PHP_HAVAL_CTX * conte
525
525
526
526
/* Pad out to 118 mod 128.
527
527
*/
528
- index = (unsigned int ) ((context -> count [0 ] >> 3 ) & 0x3f );
528
+ index = (unsigned int ) ((context -> count [0 ] >> 3 ) & 0x7f );
529
529
padLen = (index < 118 ) ? (118 - index ) : (246 - index );
530
530
PHP_HAVALUpdate (context , PADDING , padLen );
531
531
0 commit comments