mj Sun, 28 Mar 2010 10:01:02 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=296963
Log: JOAAT hashing now supports incremental hashing. Changed paths: U php/php-src/trunk/ext/hash/hash_joaat.c U php/php-src/trunk/ext/hash/php_hash_joaat.h U php/php-src/trunk/ext/hash/tests/hash_copy_001.phpt Modified: php/php-src/trunk/ext/hash/hash_joaat.c =================================================================== --- php/php-src/trunk/ext/hash/hash_joaat.c 2010-03-28 09:04:51 UTC (rev 296962) +++ php/php-src/trunk/ext/hash/hash_joaat.c 2010-03-28 10:01:02 UTC (rev 296963) @@ -42,7 +42,7 @@ PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, unsigned int inputLen) { - context->state = joaat_buf((void *)input, inputLen); + context->state = joaat_buf((void *)input, inputLen, context->state); } PHP_HASH_API void PHP_JOAATFinal(unsigned char digest[4], PHP_JOAAT_CTX * context) @@ -71,9 +71,8 @@ * 32 bit hash as a static hash type */ static php_hash_uint32 -joaat_buf(void *buf, size_t len) +joaat_buf(void *buf, size_t len, php_hash_uint32 hval) { - php_hash_uint32 hval = 0; size_t i; unsigned char *input = (unsigned char *)buf; Modified: php/php-src/trunk/ext/hash/php_hash_joaat.h =================================================================== --- php/php-src/trunk/ext/hash/php_hash_joaat.h 2010-03-28 09:04:51 UTC (rev 296962) +++ php/php-src/trunk/ext/hash/php_hash_joaat.h 2010-03-28 10:01:02 UTC (rev 296963) @@ -29,7 +29,7 @@ PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, unsigned int inputLen); PHP_HASH_API void PHP_JOAATFinal(unsigned char digest[16], PHP_JOAAT_CTX * context); -static php_hash_uint32 joaat_buf(void *buf, size_t len); +static php_hash_uint32 joaat_buf(void *buf, size_t len, php_hash_uint32 hval); #endif Modified: php/php-src/trunk/ext/hash/tests/hash_copy_001.phpt =================================================================== --- php/php-src/trunk/ext/hash/tests/hash_copy_001.phpt 2010-03-28 09:04:51 UTC (rev 296962) +++ php/php-src/trunk/ext/hash/tests/hash_copy_001.phpt 2010-03-28 10:01:02 UTC (rev 296963) @@ -253,7 +253,7 @@ string(16) "5e8c64fba6a5ffcf" string(5) "joaat" string(8) "aaebf370" -string(8) "72e280c2" +string(8) "513479b4" string(10) "haval128,3" string(32) "86362472c8895e68e223ef8b3711d8d9" string(32) "ebeeeb05c18af1e53d2d127b561d5e0d"
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php