We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f9bdb7 commit 0a1eebfCopy full SHA for 0a1eebf
src/ethereum/osaka/vm/precompiled_contracts/modexp.py
@@ -95,11 +95,10 @@ def complexity(base_length: U256, modulus_length: U256) -> Uint:
95
"""
96
max_length = max(Uint(base_length), Uint(modulus_length))
97
words = (max_length + Uint(7)) // Uint(8)
98
- complexity = words ** Uint(2)
99
- if max_length <= Uint(32):
100
- return complexity
101
- else:
102
- return Uint(2) * complexity
+ complexity = Uint(16)
+ if max_length > Uint(32):
+ complexity = Uint(2) * words ** Uint(2)
+ return complexity
103
104
105
def iterations(exponent_length: U256, exponent_head: U256) -> Uint:
0 commit comments