Skip to content

51x5 inverse (WIP) - #21

Draft
mitschabaude wants to merge 1 commit into
mainfrom
feature/51x5-inverse
Draft

mitschabaude wants to merge 1 commit into
mainfrom
feature/51x5-inverse

Conversation

@mitschabaude

Copy link
Copy Markdown
Owner

Summary

Stacked on feature/51x5-curve-ops because it depends on fieldWithMethods / FieldLayout / bigintToData from that branch. Retarget to main once #20 merges.

Test plan

  • Property test makeOdd against a JS reference (u/2^k / s*2^k for k = ctz(u))
  • Property test almostInverse — check the returned k and the invariant r * a ≡ ±2^k (mod p)
  • End-to-end: inverse(scratch, r, a); multiply(r, r, a) === 2^K (Montgomery form of 1)
  • Cross-check against FpBigint.inverse via createEquivalentWasm
  • Edge cases: a = 1, a = p-1, a small (< 2^51)

🤖 Generated with Claude Code

Base automatically changed from feature/51x5-curve-ops to main April 22, 2026 11:27
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.

1 participant