@@ -2254,6 +2254,19 @@ Precompiled Contracts
22542254 rule <k> MODEXP => #end EVMC_SUCCESS ... </k>
22552255 <callData> DATA </callData>
22562256 <output> _ => #modexp1(#asWord(#range(DATA, 0, 32)), #asWord(#range(DATA, 32, 32)), #asWord(#range(DATA, 64, 32)), #range(DATA, 96, maxInt(0, lengthBytes(DATA) -Int 96))) </output>
2257+ <schedule> SCHED </schedule>
2258+ requires notBool Ghaseip7823 << SCHED >>
2259+ orBool modexpUBCheck(#asWord(#range(DATA, 0, 32)), #asWord(#range(DATA, 32, 32)), #asWord(#range(DATA, 64, 32)))
2260+
2261+ rule <k> MODEXP => #end EVMC_PRECOMPILE_FAILURE ... </k>
2262+ <callData> DATA </callData>
2263+ <schedule> SCHED </schedule>
2264+ requires Ghaseip7823 << SCHED >>
2265+ andBool notBool modexpUBCheck(#asWord(#range(DATA, 0, 32)), #asWord(#range(DATA, 32, 32)), #asWord(#range(DATA, 64, 32)))
2266+
2267+ syntax Bool ::= modexpUBCheck (Int , Int , Int) [symbol(modexpUBCheck), function, total]
2268+ // ----------------------------------------------------------------------------------------
2269+ rule modexpUBCheck(BASELEN, EXPLEN, MODLEN) => BASELEN <=Int 1024 andBool EXPLEN <=Int 1024 andBool MODLEN <=Int 1024
22572270
22582271 syntax Bytes ::= #modexp1 ( Int , Int , Int , Bytes ) [symbol(#modexp1), function]
22592272 | #modexp2 ( Int , Int , Int , Bytes ) [symbol(#modexp2), function]
0 commit comments