aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/crypto.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-23 01:15:11 +0800
committerobscuren <geffobscura@gmail.com>2015-01-23 01:15:11 +0800
commit0dfe5113709d2981ef2ec8885d831a38cf2e4f91 (patch)
tree3bf57771b92f014aad4591b9600e57d3897f7f70 /crypto/crypto.go
parentd4cc2d3503ce7497ef0cb39456a332b25e0999b9 (diff)
downloadgo-tangerine-0dfe5113709d2981ef2ec8885d831a38cf2e4f91.tar.gz
go-tangerine-0dfe5113709d2981ef2ec8885d831a38cf2e4f91.tar.zst
go-tangerine-0dfe5113709d2981ef2ec8885d831a38cf2e4f91.zip
Use curve params instead of hardcoded 32 bytes
Diffstat (limited to 'crypto/crypto.go')
-rw-r--r--crypto/crypto.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/crypto.go b/crypto/crypto.go
index 3da69ea94..93453b91c 100644
--- a/crypto/crypto.go
+++ b/crypto/crypto.go
@@ -106,7 +106,7 @@ func Sign(hash []byte, prv *ecdsa.PrivateKey) (sig []byte, err error) {
return nil, fmt.Errorf("hash is required to be exactly 32 bytes (%d)", len(hash))
}
- sig, err = secp256k1.Sign(hash, ethutil.LeftPadBytes(prv.D.Bytes(), 32))
+ sig, err = secp256k1.Sign(hash, ethutil.LeftPadBytes(prv.D.Bytes(), prv.Params().BitSize/8))
return
}