Em 2013-02-20 8:09, Tjerk Anne Meesters escreveu:
Hi,

I've forked out an interesting project on Github that implements XXHash and extended it to work with the hash() function family. Project links below.

The integration is pretty straightforward, but the following code had me
concerned:

PHP_HASH_API void PHP_XXH32Update(PHP_XXH32_CTX *context, const unsigned
char *input, unsigned int inputLen)
{
        XXH32_feed(context->state, (void *)input, (int)inputLen);
}

The XXH32_feed() takes an int argument, whereas the update ops function
takes an unsigned int for the input length.

Would that ever give a problem? If so, what kind of workaround am I looking
at?


Not unless and unsigned int with a value larger than INT_MAX is passed. I took a quick look at the calls to ->hash_update and the largest value potentially passed seems to be from a PHP string (via php_hash_hmac_round), which has an int for the length and therefore is not a problem.

--
Gustavo Lopes

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to