ethereumjs-wallet icon indicating copy to clipboard operation
ethereumjs-wallet copied to clipboard

fix generate now can't throw exception

Open vird opened this issue 4 years ago • 3 comments

Based on: fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 Probability of throw was ~1/2**499 But after fix it should never throw

vird avatar Nov 02 '21 10:11 vird

Hi there, thanks for the PR! 🙂

Could you please give some more context and explain what you are doing here?

holgerd77 avatar Nov 03 '21 17:11 holgerd77

Coverage Status

Coverage increased (+0.05%) to 85.036% when pulling 6ee26f68184ab3d9fb7a82653904a0c5b09bb5a0 on vird:fix/generate_now_cant_throw_exception into 83c1b1aa601977e5b0bbcf3e09353c91f993ff54 on ethereumjs:master.

coveralls avatar Nov 03 '21 17:11 coveralls

randomBytes(32) is used in current implementation of .generate() for generating new wallet. But this is not 100% correct way to properly generate ECDSA point for private key. My fix allows code to be formally correct and never throw exception (even with astronomically low probability)

vird avatar Nov 04 '21 09:11 vird