multiformats/multihash

Parameterized hashing

indolering opened this issue · 3 comments

Different types of hashing may require parameters not currently specified, for example Argon2 has parameters for iterations, memory usage and parallelism. On the one hand, such parameters could be viewed like a salt and treated out-of-band. However, swapping out Argon2 with a hypothetical Argon3 would be much easier if such parameters were treated in-band - similar to length.

As one cannot anticipate the needs of future hash functions, I believe this would require a new arbitrary length <params> such fields would require a new <params> section. Thoughts?

It seems the current policy is to add entries to the table for each "acceptable" generation value:

https://github.com/multiformats/multihash/blob/master/hashtable.csv

Probably not the best policy when it comes to very arbitrary params or hash functions with many inputs.

Let's move this to #37.