-
Notifications
You must be signed in to change notification settings - Fork 114
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
Mapping to openssl implementations #58
Comments
Basically, what you see in the hashtable defined by multihash are hash functions which we have already given function codes. We mention in the README that there are other tables, too, which exist; your list looks like another possible table we could link. Specifically, it is returning names for hash algorithms as defined by You'll have to look closer and figure out which hashing algorithm you are using specifically, and see if it is in the multihash table, and it if isn't, feel free to PR with a new function code. Thanks to @Kubuxu and |
It's a bit subtle indeed. Do you happen to know of a correct mapping between a multihash function code and some (secure) hash function I can use from node? For instance the hash function that IPFS uses in it's JS implementation? If not I'd proceed scouring through it's source or I'll dive into some docs to figure out which name maps where. Thanks for your (joint) efforts! |
BTW. Since the hash functions are deterministic, it would be very easy to compute a few hash values for each function and make them part of the Pick a few random numbers and you are near certain if hash function matches the code or not. (Unless I'm missing some more subtle things about hash functions)
You should even be able to detect which code should be used for a given function fully automatically, without requiring an explicit mapping. You can probably find some minimum set of colums needed to add to the specification to detect all listed hash functions without collision. In other words, I rather take such a table and write a program that computes and verifies my wanted mapping between multihash and OpenSSL. |
I personally don't. @diasdavid might have a better idea of what is used. You're right, I believe, that it should be easy to add some hash values to verify that you are using the right function. I think this is a good idea, but it's a bit beyond the scope of this issue; perhaps open that idea in another one? |
How exactly does this table
hashtable.csv
map to the implementation in openssl, as used by say node:https://stackoverflow.com/questions/14168703/crypto-algorithm-list
I'm not sure which hash function would give a correct hash to label it
sha2-256
for instance,is it
RSA-SHA256
sha256
? etc...Could you provide any guidance on this?
thnx :-)
The text was updated successfully, but these errors were encountered: