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

Switch from js-sha3 and blake to audited noble-hashes #547

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

paulmillr
Copy link

@paulmillr paulmillr commented Jan 20, 2025

noble cryptography (https://github.com/paulmillr/noble-hashes) is high-security, easily auditable set of contained cryptographic libraries and tools. It would be great to use it instead of some unknown library. Benefits:

  • Audited, less resources would be necessary for end-users to audit dep trail
  • Smaller bundle size
  • Is used by millions of users (see npm)
  • Since it's everywhere (e.g. in ethers.js), it would get de-duplicated by end-users when two packages depend on noble
  • Is actually maintained, has modern features like esm / typescript / bun / deno friendliness

All PRs:

Originally proposed 15 months ago in #416

}

export function fromPartialHash(partial) {
// NOTE: this is unsafe and uses internal API
Copy link
Member

Choose a reason for hiding this comment

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

Hello @paulmillr!
Thank you for your contribution! I imagine it was a lot of work!
Can you please elaborate on this comment? Why is it unsafe?
Just because of the usage of internal API or there are other considerations?

Copy link
Author

Choose a reason for hiding this comment

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

It’s because it uses internal api.

stuff like this is never exposed in libraries.

Copy link
Author

Choose a reason for hiding this comment

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

Why do you need "partial hashes"?

@OBrezhniev
Copy link
Member

@Kolezhniuk can you please test this build on our multiplatform tests setup?

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.

2 participants