aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/signature_cgo.go
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/signature_cgo.go')
-rw-r--r--crypto/signature_cgo.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/signature_cgo.go b/crypto/signature_cgo.go
index 5faa6061f..d1485de08 100644
--- a/crypto/signature_cgo.go
+++ b/crypto/signature_cgo.go
@@ -23,7 +23,7 @@ import (
"crypto/elliptic"
"fmt"
- "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto/secp256k1"
)
@@ -53,7 +53,7 @@ func Sign(hash []byte, prv *ecdsa.PrivateKey) (sig []byte, err error) {
if len(hash) != 32 {
return nil, fmt.Errorf("hash is required to be exactly 32 bytes (%d)", len(hash))
}
- seckey := common.LeftPadBytes(prv.D.Bytes(), prv.Params().BitSize/8)
+ seckey := math.PaddedBigBytes(prv.D, prv.Params().BitSize/8)
defer zeroBytes(seckey)
return secp256k1.Sign(hash, seckey)
}