Skip to content

Conversation

@radik878
Copy link
Contributor

@radik878 radik878 commented Dec 8, 2025

Description

Replace per-byte accumulation in from_le_bytes_mod_order with 8-byte chunking using a precomputed 2^64 window. This reduces field multiplications by ~8x on long inputs while preserving semantics and constant-time field operations. Also rework from_be_bytes_mod_order to avoid reversing into a new Vec by streaming big-endian input in 2^64 chunks.

  • Targeted PR against correct branch (master)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer

@radik878 radik878 requested review from a team as code owners December 8, 2025 19:43
@radik878 radik878 requested review from mmagician, weikengchen and z-tech and removed request for a team December 8, 2025 19:43
@Pratyush
Copy link
Member

Thank you for the PR! Could you add tests that show the behaviour is preserved? E.g. specifically in test-templates?

@radik878
Copy link
Contributor Author

Thank you for the PR! Could you add tests that show the behaviour is preserved? E.g. specifically in test-templates?

Did it!

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