-
Notifications
You must be signed in to change notification settings - Fork 297
Signatures #2
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
Signatures #2
Conversation
|
I've found most of the culprit, need more test on other environment, should I create a new pull ? |
|
@devi thanks! I'm testing it right now. No need for a new PR, I'll just pull directly from you. |
|
Right now only one of the 40-byte messages fail: ( (I'm using this version: https://github.com/devi/tweetnacl-js/commit/f9a72ffa3708c89c6574a13ae21bba1a709e18ec) |
|
I've replaced a random message with repeats of "x" like this in -var msg = crypto.randomBytes(i).toString('base64');
+var msg = new Array(i).join('x');and it fails when length is 28: Do you think it's |
|
Added hash test:
It passes, so it looks like SHA-512 implementation is OK. |
|
@devi Awesome! I've tried and it runs 100 sign tests successfully. I'll let it run with random strings for a few hours to be sure, then go through the code again, and then merge (not sure if I'll have time today, so give me a few days :). Thanks again for the great work! 👍 |
|
@dchest Thanks to you! You've teached me a lot from this pull. |
* Reordered functions so that they appear in order similar to tweetnacl.c. * Replaced while loops with for loops to match tweenacl.c. * In pack25519, change t from empty array to new gf() -- which makes the test fail again on 29-byte messages unless we observe n or t with console.log. This needs investigation.
|
All right, I merged it! Thanks again. Also, I think one of the test failures was caused by a Node bug: #5 |
Changes from https://github.com/devi/tweetnacl-js/tree/sha512 + new tests for signatures.
Signature test signs a random message in JS, then signs the same message with a C program using the latest tweetnacl.c, then compares the result and tries to open it.
To run sign test,
Currently sign test doesn't pass fully, e.g.: