Open simonmcallister0210 opened 8 months ago
Also worth noting, crypto-js was discontinued as of October 2023. I'm not an expert on crypto stuff, but this issue might be useful for migrating over to the node:crypto equivalents of crypto-js functionality.
Yes it's been at the back of my mind for a while and I've been thinking about how to approach it. I definitely want to move over to the standard crypto library very soon
I wasn't aware of this issue. Some useful info in there that'll come in handy. Thanks! If you (or anyone else) find any more useful guides or discussions feel free to drop them here. It'll make my life a lot easier when we eventually do make the transition 😁
I'm using React Native with Hermes and I was experiencing 5+ second waits on an iPhone 16.
I'm using the buffer polyfill. I did some profiling on both buffer and crypto-js and neither seemed to be the problem. Rather it seems it is jsbn. Replacing its BigInteger with the in-built BigInt gives me pretty good performance (around 6 times faster).
See my fork.
I know using BigInt may not work for everyone. If not, would it be possible to make the BigInteger library configurable?
After updating the test matrix to include Node v21 I noticed signing takes ages, causing tests to fail. Maybe this is something to do with the fact I'm still using CryptoJS? I'm not sure...
I think for now we should look into moving over to the built-in crypto functions. Might improve performance and should have the added benefit of reducing the package size