Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add modexp precomile MVP - only for uint256 numbers (#475)
<!--- Please provide a general summary of your changes in the title above --> ModExp MVP precompile implementation. MVP is missing support for bigint since there is no bigint or arbitrary size and arithmetics implementation in cairo 0.10.3. Both integration and unit tests are passing. <!-- Give an estimate of the time you spent on this PR in terms of work days. Did you spend 0.5 days on this PR or rather 2 days? --> Time spent on this PR: 7 days ## Pull request type <!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. --> Please check the type of change your PR introduces: - [ ] Bugfix - [x] Feature - [ ] Code style update (formatting, renaming) - [ ] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] Documentation content changes - [ ] Other (please describe): ## What is the current behavior? <!-- Please describe the current behavior that you are modifying, or link to a relevant issue. --> Resolves #361 ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Calculates modular exponentiation via algorithm that requires log_2(exponent) loops. - In cairo this requires ~500k steps for 32-bit numbers - It's not possible to do this in the hint(if it could get whitelisted) since checking the result after the hint is too heavy to compute ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> --------- Co-authored-by: Elias Tazartes <66871571+Eikix@users.noreply.github.com> Co-authored-by: Dragan Pilipovic <draganpilipovic@Dragans-MacBook-Pro.local>
- Loading branch information