Open veorq opened 11 years ago
updated if function get null string, it will return None
Still does not support arbitrary data (ie that includes null bytes); why be limited to strings?
sorry I'm still busy. =) I'll fix it in two days.
@pgonee fixed this. thx!
Thanks, but I still don't understand why strings with null bytes are not supported; why should the API be limited to strings of characters, rather than arbitrary byte strings?
On Tue, Feb 19, 2013 at 7:46 AM, Bae KwonHan notifications@github.comwrote:
@pgonee https://github.com/pgonee fixed this. thx!
— Reply to this email directly or view it on GitHubhttps://github.com/darjeeling/python-blake2/issues/2#issuecomment-13759225.
@aumasson Still not working? perhaps I think the fixed version of python-blake2 is not yet uploaded to PyPI. Try to clone this repository directly or ask @darjeeling .
Have not tried the module, just read "Pull Request #3: string containing \x00 raises unexpected exception." on https://github.com/darjeeling/python-blake2/issues/2
On Tue, Feb 19, 2013 at 8:03 AM, EUNJO WI notifications@github.com wrote:
@aumasson Still not working? perhaps I think the fixed version of python-blake2 is not yet uploaded to PyPI. Try to clone this repository directly or ask @darjeeling .
— Reply to this email directly or view it on GitHub.
@aumasson No. I'm afraid you misunderstood. There was a bug that the string containing \x00 raises unexpected exception, exactly what you experienced. and thus I fixed it. Check it out again.
In short, strings with null bytes are supported now. ^^
Ok, sorry for misunderstanding.
There is something strange though:
import blake2 blake2.blake2('\x00') '507ed301000000008fa05700000000004098d3010000000025c15700000000000005da01000000001c104135167f000078cabc00ff7f000080cabc00ff7f0000' blake2.blake2('\x00') '507ed301000000008fa057000000000050006637167f00008fa05700000000000005da01000000001c104135167f000078cabc00ff7f000080cabc00ff7f0000' blake2.blake2('\x01') '507ed301000000008fa05700000000008005da010000000000000000000000003005da01000000001c104135167f000078cabc00ff7f000080cabc00ff7f0000' blake2.blake2('\x01') '507ed301000000008fa05700000000005005da010000000000000000000000000005da01000000001c104135167f000078cabc00ff7f000080cabc00ff7f0000'
Note that the hash of \x00 is different when computed twice. Also, why do we have all those zeros?
On Tue, Feb 19, 2013 at 8:12 AM, EUNJO WI notifications@github.com wrote:
@aumasson https://github.com/aumasson No. I'm afraid you misunderstood. There was a bug that the string containing \x00 raises unexpected exception, exactly what you experienced. and thus I fixed it. Check it out again.
— Reply to this email directly or view it on GitHubhttps://github.com/darjeeling/python-blake2/issues/2#issuecomment-13759810.
The version in Pypi is still returning None when given a string containing a null character. This is a critical bug which renders the library completely unusable. Null strings are valid inputs for hash functions, and should result in hash outputs not None. It's utterly bizarre that this bug is in there, because it seems like something you'd have to specifically add.
Data that includes null bytes seems to throw an exception:
Same with blake2.blake2b and blake2.blake2s.