paulmillr / noble-secp256k1

Fastest 4KB JS implementation of secp256k1 signatures and ECDH
https://paulmillr.com/noble
MIT License
757 stars 114 forks source link

removed bigint exponentiation operator that crashes some builds #59

Closed alex-nax closed 2 years ago

alex-nax commented 2 years ago

fixes issue https://github.com/polkadot-js/common/issues/1321

paulmillr commented 2 years ago

This is rare bundler issue. I don't like to make the code shitty because of some exotic bundler builds. We have enough of shit code e.g. we're not using 1234n directly anymore.

paulmillr commented 2 years ago

e.g. 115792089237316195423570985008687907853269984665640564039457584007913129639936 needs to be verified by hand! 2**256 doesn't

alex-nax commented 2 years ago

This is rare bundler issue. I don't like to make the code shitty because of some exotic bundler builds. We have enough of shit code e.g. we're not using 1234n directly anymore.

It fails on react-native environments

paulmillr commented 2 years ago

upgrade your react-native then.

alex-nax commented 2 years ago

the problem is with this code https://github.com/facebook/metro/blob/main/packages/metro-react-native-babel-preset/src/configs/main.js#L121 there is an open issue that addresses this problem from feb 18 https://github.com/facebook/metro/issues/359 but there's nothing done((

lf94 commented 2 years ago

@paulmillr it'd be better performance-wise if this was used instead for the react-native variant...

paulmillr commented 2 years ago

@lf94 no it's not better. If you say it is better, provide some benchmarks.