Repository navigation
Treat intermediate identity as identity in pubkey/privkey sums #32
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -491,3 +491,21 @@ it("can detect incoming payment in tx output (having output script only) using | |
|
|
||
| console.log("1000 tweak mults took", (end - start) / 1000, "sec"); | ||
| }); | ||
|
|
||
| it("sumPubKeys is order-independent when an intermediate sum is the point at infinity", () => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [HIGH] Your test plan promised both key orders for pubkey and privkey sums. I only see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [HIGH] You patched the 'stop at intermediate zero' bug but never verify the actual failure boundary: |
||
| // Reporter scalars from BlueWallet/SilentPayments#30 (A + (-A) = 0 mod n). | ||
| const a = hexToUint8Array("a6df6a0bb448992a301df4258e06a89fe7cf7146f59ac3bd5ff26083acb22ceb"); | ||
| const minusA = hexToUint8Array("592095f44bb766d5cfe20bda71f9575ed2df6b9fb9addc7e5fdffe0923841456"); | ||
| const Apub = ecc.pointFromScalar(a, true); | ||
| const minusApub = ecc.pointFromScalar(minusA, true); | ||
| assert.ok(Apub); | ||
| assert.ok(minusApub); | ||
|
|
||
| const cancelFirst = SilentPayment.sumPubKeys([Apub, minusApub, Apub]); | ||
| const cancelLast = SilentPayment.sumPubKeys([Apub, Apub, minusApub]); | ||
|
|
||
| expect(cancelFirst).not.toBeNull(); | ||
| expect(cancelLast).not.toBeNull(); | ||
| assert.deepStrictEqual(cancelFirst, cancelLast); | ||
| assert.deepStrictEqual(cancelFirst, Apub); | ||
| }); | ||
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.
[MEDIUM] After infinity you blindly adopt the next pubkey as
result.getPubkeysFromTransactionInputsfeeds x-only 32-byte keys; the very nextpointAddat 321 demands compressed/uncompressed and throws. Compressed cancel-then-x-only still detonates — you fixed one ordering trap and left a mixed-encoding trapdoor.