diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 539d34388a..278746e02c 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -407,12 +407,18 @@ func (c *bigModExp) RequiredGas(input []byte) uint64 { func (c *bigModExp) Run(input []byte) ([]byte, error) { var ( - baseLen = new(big.Int).SetBytes(getData(input, 0, 32)).Uint64() - expLen = new(big.Int).SetBytes(getData(input, 32, 32)).Uint64() - modLen = new(big.Int).SetBytes(getData(input, 64, 32)).Uint64() + baseLenBigInt = new(big.Int).SetBytes(getData(input, 0, 32)) + expLenBigInt = new(big.Int).SetBytes(getData(input, 32, 32)) + modLenBigInt = new(big.Int).SetBytes(getData(input, 64, 32)) + ) + var ( + baseLen = baseLenBigInt.Uint64() + expLen = expLenBigInt.Uint64() + modLen = modLenBigInt.Uint64() ) // Check that all inputs are `u256` (32 - bytes) or less, revert otherwise - if baseLen > 32 || expLen > 32 || modLen > 32 { + var lenLimit = new(big.Int).SetInt64(32) + if baseLenBigInt.Cmp(lenLimit) > 0 || expLenBigInt.Cmp(lenLimit) > 0 || modLenBigInt.Cmp(lenLimit) > 0 { return nil, errModexpUnsupportedInput } if len(input) > 96 { diff --git a/params/version.go b/params/version.go index 0802f41b38..f525aa1228 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 4 // Major version component of the current release VersionMinor = 3 // Minor version component of the current release - VersionPatch = 57 // Patch version component of the current release + VersionPatch = 58 // Patch version component of the current release VersionMeta = "sepolia" // Version metadata to append to the version string )