-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: 🎸 js implment for issue 246 #274
Conversation
issue 246: java PR#248, validate point against curve ✅ Closes: #246
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🟡 | Statements | 72.4% | 1894/2616 |
🔴 | Branches | 45.32% (+1.24% 🔼) |
247/545 |
🟡 | Functions | 79.41% | 351/442 |
🟡 | Lines | 72.59% | 1856/2557 |
Show files with reduced coverage 🔻
St.❔ |
File | Statements | Branches | Functions | Lines |
---|---|---|---|---|---|
🟢 | libs/utils.ts | 86.7% | 63.89% (-1.39% 🔻) |
94.12% | 87.94% |
🟡 | ... / AttestationCrypto.ts |
66.42% (-2.15% 🔻) |
37.04% (-2.96% 🔻) |
90.91% | 66.67% (-2.27% 🔻) |
🟡 | ... / FullProofOfExponent.ts |
67.86% (-2.6% 🔻) |
53.33% (+53.33% 🔼) |
78.57% (+1.65% 🔼) |
67.86% (-2.6% 🔻) |
Test suite run success
38 tests passing in 2 suites.
Report generated by 🧪jest coverage report action from 6829c34
@oleggrib that is a very good question! Normalisation should not have any influence here (normalisation only has something to do with internal representation of a point on a curve). Basically when the check fails it mathematically means that the point does not have the correct order. In non-math terms it means that the point is not safe to use. |
I had a quick check on the Authenticator code and I could not find anything wrong with your code. The risk is that one of the libraries used might contain a bug. |
Looking a bit closer it might be an issue with the code in |
it fails for example in next tests: so in both cases it failed. how it fails: maybe it can help you to understand how to solve the issue. @jot2re |
@oleggrib Okay, it took me awhile to figure out the problem because I thought it was something completely different. It turned out to be super simple. The check you mentioned simply needed to be done with a positive value. But another issue was that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked and everything looks good. There were a couple of checks missing which I added. Everything runs locally on my machine.
issue 246: java PR#248, validate point against curve
✅ Closes: #246
@jot2re , can you check what is wrong with code :
https://github.com/TokenScript/attestation/blob/246-js-constanttime/src/main/javascript/crypto/src/libs/AttestationCrypto.ts#L389-L393
sometimes it gets symetric points, but maybe because of missing normalization it breaks. Maybe you can help to solve it.
or help me to understand reason of
point.multiplyDA(curve.n).isInfinity()