Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Affine doubling incorrectly returns infinity for a horizontal tangent. On y²=x³+1 over GF(17), doubling (0,1) should give (0,16). Jacobian multiplication also treats every zero-Y point as infinity, losing finite order-two points. Equivalent projective coordinates can take the wrong addition branch, and affine negation can return a noncanonical coordinate.
This patch handles vertical tangents before inversion, applies scalar parity to finite order-two points, reduces coordinate differences before testing for equal Jacobian points, and returns canonical affine negations. It preserves the existing off-curve zero-point compatibility test.
Regression and independent validation
Validated against upstream master 71e3fc7 (still current at submission):
These are recorded local validation results; GitHub CI is separate. The uploaded source and regression file were byte-compared with the validated local files. Arithmetic module SHA-256:
70bfd96a17e646af484a93d08fbe16df21ba5256358c657f64a19766538d67df.Impact
Confirmed effects are incorrect arithmetic and false positive/false negative subgroup decisions on the custom 18-point curve. Its finite order-three members are (0,1) and (0,16): the base affine calculation misses both, while the base Jacobian calculation also admits (16,0), an order-two point. Point orders are unspecified in this check.
Applications relying on these low-level paths for custom or cofactor-bearing curves may make incorrect decisions. Source inspection identifies the multiplication-based subgroup test in
ecdsa.Public_key.__init__as a potential propagation path; end-to-end exploitation through that path has not been demonstrated. Deployment impact, practical standard-curve reachability, signature forgery and key recovery remain unverified.Report, PoC and evidence
The attached bundle includes the full bug report and impact analysis, runnable arithmetic PoC, before/after outputs, patch, source identities, regression receipts, both original Sage harnesses and results, authoritative parameter tuples, and replay instructions. JUnit hostname attributes were removed for publication; test outcomes are unchanged.
MANIFEST.jsonrecords the published files’ SHA-256 digests.python-ecdsa-arithmetic-evidence.zip