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

Add ripemd definitions #175

Merged
merged 2 commits into from
May 20, 2020
Merged

Add ripemd definitions #175

merged 2 commits into from
May 20, 2020

Conversation

mvandeberg
Copy link
Contributor

As proposed in #117, there are no definitions for the ripemd family of hashes.

The previous PR would have been sufficient with the given feedback, but the author never made the requested changes and the PR is now over a year old.

This PR would replace #117.

It conforms to feedback on #117, with the more common ripemd-160 hash using the one byte space and the less common algorithms using the two byte space.

0x52 was chosen somewhat arbitrarily as the ASCII encoding of 'R'.

Furthermore, 0x51 is the serialization code for CBOR, which means 0x52 is unlikely to be needed as a value in relation to CBOR.

@ribasushi
Copy link

Note that there are multiple precedents for "non-FIPS" hash functions to live outside of the single-byte space, the most notable example being blake2b-256.

Is burning 0x52 for a function exclusively used in bitcoin addressing these days really warranted?

@rvagg
Copy link
Member

rvagg commented May 16, 2020

I'm kind of with @ribasushi on this and would rather keep them together as a family - it certainly makes it easier to look them up - but that does somewhat contradict the previous ask in #117.

What would be the justification for using one-byte for 160? Is there a common usage that we'd expect this to attract that would benefit from shortest-possible representation? Even in Bitcoin I think the only usage is over the top of a sha2-256 as well, a combination that might warrant its own entry in here (in the same fashion as dbl-sha2-256) if they were to be put into common usage.

Also there's the 0xbX block that's got plenty of holes if we're looking for an arbitrary spot in the one-byte range, 0xbf might be easier to justify than the one here if it's true that Bitcoin are pretty much the only users of 160 today.

@vmx
Copy link
Member

vmx commented May 18, 2020

These days we try to put as little as possible in the <0x80 range. Some things in there are due to historic reasons and wouldn't likely end up there today. So I suggest moving the ripemd-160 also to the same range as the others.

@mvandeberg
Copy link
Contributor Author

ripemd-160 has been moved to the two byte range and is contiguous with other ripemd sizes.

Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll wait 48h for any objections from @Stebalien, if not, I'll merge it.

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objections but I wouldn't use these in practice.

@vmx vmx merged commit 840ffc1 into multiformats:master May 20, 2020
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

Successfully merging this pull request may close these issues.

5 participants