-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
web3.js: Investigate replacement for tweetnacl
#26933
Comments
Even if you replace It's either subtle crypto, or node.js built-in, which is replaced by |
|
So if it's "shimmed", sha512 could also be shimmed. In node.js noble-ed25519 uses the same |
I've went ahead and decided to add sync support to ed25519. It took one commit paulmillr/noble-ed25519@d6263e0, 50 lines of code and a few hours of work. Usage is as following: import { sha512 } from '@noble/hashes/sha512';
ed.utils.sha512Sync = (...m) => sha512(ed.utils.concatBytes(...m));
const { getPublicKey, sign, verify, getExtendedPublicKey } = ed.sync;
// Use it freely
getPublicKey(privKey); |
Overview
This is the ed25519 library that we use to:
Properties:
Alternatives (ruled out)
@noble/ed25519
Properties:
SubtleCrypto
sign()
returns aPromise
dazoe/ed25519
Does not run in browser.
supercop.js
Is >130KB
nazar-pc/supercop.wasm
Introduces asynchronicity because of WASM initialization step.
nkeys.js
Just a wrapper around
tweetnacl
.substack/ed25519-supercop
Does not run in browser.
xwi88/crypto
Just a wrapper around
tweetnacl
.BENMFeng/Ed25519_DS
Just a wrapper around
tweetnacl
.skorotkiewicz/ed25519-keys
Is >45KB
The text was updated successfully, but these errors were encountered: