Skip to content

Commit 0a1eebf

Browse files
spencer-tbSamWilsn
authored andcommitted
chore(osaka): update modexp eip-7883.
1 parent 9f9bdb7 commit 0a1eebf

File tree

1 file changed

+4
-5
lines changed
  • src/ethereum/osaka/vm/precompiled_contracts

1 file changed

+4
-5
lines changed

src/ethereum/osaka/vm/precompiled_contracts/modexp.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ def complexity(base_length: U256, modulus_length: U256) -> Uint:
9595
"""
9696
max_length = max(Uint(base_length), Uint(modulus_length))
9797
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
98+
complexity = Uint(16)
99+
if max_length > Uint(32):
100+
complexity = Uint(2) * words ** Uint(2)
101+
return complexity
103102

104103

105104
def iterations(exponent_length: U256, exponent_head: U256) -> Uint:

0 commit comments

Comments
 (0)