paulmillr / noble-hashes

Audited & minimal JS implementation of hash functions, MACs and KDFs.
https://paulmillr.com/noble
MIT License
545 stars 46 forks source link

feat: add groestl hash functions with unit tests #80

Closed HashEngineering closed 7 months ago

HashEngineering commented 7 months ago

The Groestl hash function is used by some crypto-curriencies as part of their proof of work algorithm. Examples include Groestlcoin. Others use Groestl along with about 10 or more others that are chained together.

Groestl was one of the SHA-3 candidates. While the Groestl hash function can support many output widths, this PR proposed the addition of two variants of the Groestl that returns 512 bits.

This PR was inspired primarily by https://github.com/Groestlcoin/groestl-hash-js, the code of which was heavily refactored to follow the scheme of noble-hashes.

paulmillr commented 7 months ago

Thanks. Why don’t you publish this as a separate package depending on noble-hashes?

HashEngineering commented 7 months ago

We didn't consider the option of a separate package. Our thinking was centered around these ideas:

Some of these ideas would have been satisfied by a separate package, except for having a single package that contains everything.

You have done great work on this project and we appreciate your time in considering this addition.

paulmillr commented 7 months ago
  1. Unfortunately we can’t add all existing hashes, there must be some criterias filtering out remaining ones. Even if it will be included, it would need to get audited, to be considered secure. Groestl is cool, however, not very popular.
  2. If you publish the groestl package, and if it would depend on noble-hashes for some primitives, which means, whoever uses groestl AND noble, will get deduplicated code for free.
  3. Everyone who is building on top of noble is welcome and I will specifically mention your published package on noble website / docs.
HashEngineering commented 7 months ago

Thank you for your time and we understand your point of view. We will consider the path of a separate package that depends on noble-hashes or forking noble-hashes depending on our requirements.

paulmillr commented 7 months ago

If there are any vars or classes that are not exported externally, which prevents you from using noble as dependency, let me know. It’s better for discoverability and community building to have dependents rather than 10 forks.