-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Node.js crypto module dependency breaks browser bundling #35
Comments
The current getRandomValues.ts does not contain |
Ah, the version thing, sorry, should have checked. Yes, I am on Thanks for your quick answer, will close here! |
Ah, and a side question, only if you are interested though, so just do let me know if you do not have the time to deal with it: We have a somewhat huge https://github.com/ethereumjs/rustbn-wasm WASM build for the elliptic curve precompiles for the EVM which would be wonderful if we could reduce in size or remove. In this context we thought if it would be possible to use the //cc @acolytec3 |
If |
Thanks a lot! 🙏 |
One more related question, is there somewhere in the API to convert a a point on the curve represented as I've tried using the below snippet for testing out various mcl constructor methods to try and generate a result that matches the output of our existing implementation. The The snippet uses await mcl.init(mcl.BN_SNARK1)
const input =
'0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002'
const output =
'030644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd315ed738c0e0a7c92e7845f96b2ae9c0a68a6a449e3538fc7ff3ebf7a5a18a2c4'
const p1 = new mcl.Fp()
p1.deserializeHexStr(input.slice(0, 128))
const p2 = new mcl.Fp()
p2.deserializeHexStr(input.slice(128, 256))
const res = mcl.add(p1, p2)
console.log(res.getStr(16)) |
mcl does not support the encoding defined in eip-197.
Remark. The top |
🙏 🙏 🙏 🙏 🙏 |
I should have used setStr( |
Hi @herumi,
Holger from EthereumJS here again (just re-discovered that I opened a PR here alread couple of years ago #17). 👋
I was just playing with some bundler for the web (
esbuild
) to test browser compatibility for our libraries, especially VM/EVM and realized that there is a dependency (aka: usage) of the native Node.js crypto module in the getRandomValues.ts file which breaks browser bundling:(so there I trie to create a bundle from our @ethereumjs/vm code)
Is this
getRandomValues.ts
file even necessary/used or did this just "sneak into the build/release"?If possible to remove and this could get a small fix (can also submit a PR if this eases things) and bugfix release that would be great! 🙂 This would improve browser UX for several of our libraries a lot!
The text was updated successfully, but these errors were encountered: