Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Feature: 0x05 modExp Precompile#97

Open
AdnanSlef wants to merge 4 commits intoblockapps:mainfrom
AdnanSlef:feature-modExpPrecompile
Open

Feature: 0x05 modExp Precompile#97
AdnanSlef wants to merge 4 commits intoblockapps:mainfrom
AdnanSlef:feature-modExpPrecompile

Conversation

@AdnanSlef
Copy link
Copy Markdown

Implements the modExp Precompile as seen in Ethereum Byzantium Fork and laid out in EIP-198.
Includes the corresponding gas calculation.

Please note, this is a little rough around the edges. PowMod could be further optimized, the output padded, etc. This is just a first pass at the implementation.

Added precompile 0x05 to `PrecompiledCode` enum in Strato Model, and implementation in EVM PrecompiledContracts.
Implementation includes parsing of arguments, then does the minimum to return the valid type.
TODO: Still need to implement the actual modular exponentiation as well as the gas calculation.
Note: Does not handle all edge cases handled by geth.
TODO: Gas calculation for modExp precompile
…f mult_complexity.

TODO implement multComplexity to complete gas calculation.
Implemented multComplexity in accordance with EIP-198.
Copy link
Copy Markdown

@aariya50 aariya50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants