Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trees are incorrect due to toUpperCase() #8

Closed
lilyannehall opened this issue Feb 8, 2016 · 3 comments
Closed

Trees are incorrect due to toUpperCase() #8

lilyannehall opened this issue Feb 8, 2016 · 3 comments

Comments

@lilyannehall
Copy link

There are a few instances where this library manipulates the input by calling toUpperCase() before inserting the leaf. This causes subsequent derived hashes to be incorrect preventing the proper verification of different leaves in the tree by another party.

I'd suggest removing all instances of toUpperCase() on input, or am I missing something here?

@c-geek
Copy link
Owner

c-geek commented Feb 9, 2016

toUpperCase() is here for historical reasons I guess, I will have a look to remove it an publish a v0.4.0.

@c-geek c-geek closed this as completed in 296ebd2 Feb 9, 2016
@c-geek
Copy link
Owner

c-geek commented Feb 9, 2016

I've added an option when using merkle defining upper case usage (default is true to avoid breaking changes):

var use_uppercase = false;
merkle('sha256', use_uppercase);

I published 0.5.0 for this purpose.

@lilyannehall
Copy link
Author

Great, thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants