The precompile may panic if the exponent length is greater than the allocable space when calling parse_bytes() to retrieve the exponent length from the input. To trigger this panic the base length and modulus length must be zero due to gas requirements.
If the exponent length is greater than isize::MAX (2^31−1 for the wasm32 platform), the modexp precompile will panic with capacity overflow.
If the exponent length is less or equal isize::MAX and there is not enough allocable space, the modexp precompile will trigger a panic.
Description
The precompile may panic if the exponent length is greater than the allocable space when calling
parse_bytes()
to retrieve the exponent length from the input. To trigger this panic the base length and modulus length must bezero
due to gas requirements.isize::MAX
(2^31−1 for the wasm32 platform), themodexp
precompile will panic withcapacity overflow
.isize::MAX
and there is not enough allocable space, themodexp
precompile will trigger a panic.