Skip to content

Pseudo-Mersenne and Montgomery reductions - #2

Merged
Gekctek merged 21 commits into
edjCase:mainfrom
research-ag:reductions
Jun 25, 2026
Merged

Gekctek merged 21 commits into
edjCase:mainfrom
research-ag:reductions

Conversation

@timohanke

Copy link
Copy Markdown
  • Fast pseudo-Mersenne reduction modulo the secp256k1 prime
    • 40% reduction in ECDSA verify on curve secp256k1
  • Montgomery reduction for the prime256v1 (P-256) prime
    • 20% reduction in ECDSA verify on curve prime256v1 (P-256)

timohanke and others added 21 commits April 30, 2026 09:29
The skill file is:
 https://github.com/research-ag/motoko-skills/tree/main/skills/code-improvements
It is installed into the local repo via:
 npx skills add research-ag/motoko-skills
curve kind comparison was incorrect
The benches were transformed to the bench-helper approach with
this skill file:
https://github.com/research-ag/motoko-skills/tree/main/skills/benchmarks-generation

The bench-helper with the "rountines" approach is generally the most precise.

The new benches are also grouped and easier to read.

The old bench had a bug in the deserialization numbers (FromBytes)
because the serialization used to construct the input was part of
the runner function and was therefore counted.
This was done with the skill file:
https://github.com/research-ag/motoko-skills/blob/main/skills/doc-strings/SKILL.md

This will report "Documentation: 100%" on mops.one
Allow more variations of newlines at the footer
as promised by the code comment
Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@timohanke

Copy link
Copy Markdown
Author

@Gekctek Please consider merging this and releasing as a new version.

@Gekctek
Gekctek merged commit b8f7547 into edjCase:main Jun 25, 2026
2 checks passed
@Gekctek

Gekctek commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Thank you once again
Published 8.0.1

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.

2 participants