paritytech / paritytech/parity-common
Multiplying two UINT256 to a UINT512
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 311
- Forks
- 245
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I need to compute a multiplication of two integers a, b modulo a big prime P. Those integers and the prime fit in a UINT256, but to compute the result of a*b mod P I need to compute a*b which doesn't fit in a UINT256. Would it be possible to add another method perfect_mul (or another name) which gives the UINT512 result in an efficient way or should I use UINT512 everywhere?
Thanks for your work,
Thomas
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the UINT256 and UINT512 implementations and their existing multiplication APIs in the Rust crates. Review how modular arithmetic and overflow are currently handled, then determine whether a dedicated widening multiplication API is appropriate. Done means the chosen API computes the full product efficiently and has coverage for multiplying two UINT256 values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100