From 8698da045fee4ef203e2581bbe257015c67fd127 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 3 Mar 2023 08:39:10 -0800 Subject: [PATCH] Fix linter --- core/vm/contracts.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 1314c24386..d7d9eeb525 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -29,6 +29,7 @@ import ( "github.com/ethereum/go-ethereum/crypto/bls12381" "github.com/ethereum/go-ethereum/crypto/bn256" "github.com/ethereum/go-ethereum/params" + big2 "github.com/holiman/big" "golang.org/x/crypto/ripemd160" ) @@ -384,6 +385,7 @@ func (c *bigModExp) Run(input []byte) ([]byte, error) { mod = new(big2.Int).SetBytes(getData(input, baseLen+expLen, modLen)) v []byte ) + switch { case mod.BitLen() == 0: // Modulo 0 is undefined, return zero @@ -394,6 +396,7 @@ func (c *bigModExp) Run(input []byte) ([]byte, error) { default: v = base.Exp(base, exp, mod).Bytes() } + return common.LeftPadBytes(v, int(modLen)), nil }