Skip to content
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

Update ecdsa-test.js, fix test failure #193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LocutusOfBorg
Copy link

new node-bn.js 5.0.0-1 gives error when the string passed to sign function is not in hex format.

   curve secp256k1
     should have `signature.s <= keys.ec.nh`:

�[0m�[31m Error: Invalid character in hello�[0m�[90m
at assert (/usr/share/nodejs/bn.js/lib/bn.js:6:21)
at parseHex (/usr/share/nodejs/bn.js/lib/bn.js:214:5)
at BN._parseHex (/usr/share/nodejs/bn.js/lib/bn.js:241:11)
at BN.init [as _init] (/usr/share/nodejs/bn.js/lib/bn.js:97:12)
at new BN (/usr/share/nodejs/bn.js/lib/bn.js:39:12)
at EC.sign (lib/elliptic/ec/index.js:99:27)
at KeyPair.sign (lib/elliptic/ec/key.js:108:18)
at Context. (test/ecdsa-test.js:64:25)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:354:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:346:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:442:10)
at /usr/lib/nodejs/mocha/lib/runner.js:560:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:356:14)
at /usr/lib/nodejs/mocha/lib/runner.js:366:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:290:14)
at /usr/lib/nodejs/mocha/lib/runner.js:329:7
at done (/usr/lib/nodejs/mocha/lib/runnable.js:301:5)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:372:7)
at Hook.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:346:7)
at next (/usr/lib/nodejs/mocha/lib/runner.js:304:10)
at Immediate._onImmediate (/usr/lib/nodejs/mocha/lib/runner.js:334:5)
�[0m

new node-bn.js 5.0.0-1 gives error when the string passed to sign function is not in hex format.

       curve secp256k1
         should have `signature.s <= keys.ec.nh`:
�[0m�[31m     Error: Invalid character in hello�[0m�[90m
      at assert (/usr/share/nodejs/bn.js/lib/bn.js:6:21)
      at parseHex (/usr/share/nodejs/bn.js/lib/bn.js:214:5)
      at BN._parseHex (/usr/share/nodejs/bn.js/lib/bn.js:241:11)
      at BN.init [as _init] (/usr/share/nodejs/bn.js/lib/bn.js:97:12)
      at new BN (/usr/share/nodejs/bn.js/lib/bn.js:39:12)
      at EC.sign (lib/elliptic/ec/index.js:99:27)
      at KeyPair.sign (lib/elliptic/ec/key.js:108:18)
      at Context.<anonymous> (test/ecdsa-test.js:64:25)
      at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:354:21)
      at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:346:7)
      at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:442:10)
      at /usr/lib/nodejs/mocha/lib/runner.js:560:12
      at next (/usr/lib/nodejs/mocha/lib/runner.js:356:14)
      at /usr/lib/nodejs/mocha/lib/runner.js:366:7
      at next (/usr/lib/nodejs/mocha/lib/runner.js:290:14)
      at /usr/lib/nodejs/mocha/lib/runner.js:329:7
      at done (/usr/lib/nodejs/mocha/lib/runnable.js:301:5)
      at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:372:7)
      at Hook.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:346:7)
      at next (/usr/lib/nodejs/mocha/lib/runner.js:304:10)
      at Immediate._onImmediate (/usr/lib/nodejs/mocha/lib/runner.js:334:5)
�[0m
@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.12% when pulling 228cfc3 on LocutusOfBorg:patch-1 into 71e4e8e on indutny:master.

@fanatid
Copy link
Contributor

fanatid commented Sep 4, 2019

Currently elliptic uses bn.js@^4.4.0, why tests should be changed?

@LocutusOfBorg
Copy link
Author

because one day bn.js will be updated, and this is a retro-compatible approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants