aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/secp256k1/curve.go
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/secp256k1/curve.go')
-rw-r--r--crypto/secp256k1/curve.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/secp256k1/curve.go b/crypto/secp256k1/curve.go
index 61cad5463..ec6d266ce 100644
--- a/crypto/secp256k1/curve.go
+++ b/crypto/secp256k1/curve.go
@@ -36,6 +36,8 @@ import (
"math/big"
"sync"
"unsafe"
+
+ "github.com/ethereum/go-ethereum/common/math"
)
/*
@@ -230,8 +232,8 @@ func (BitCurve *BitCurve) ScalarMult(Bx, By *big.Int, scalar []byte) (*big.Int,
// Do the multiplication in C, updating point.
point := make([]byte, 64)
- readBits(point[:32], Bx)
- readBits(point[32:], By)
+ math.ReadBits(Bx, point[:32])
+ math.ReadBits(By, point[32:])
pointPtr := (*C.uchar)(unsafe.Pointer(&point[0]))
scalarPtr := (*C.uchar)(unsafe.Pointer(&scalar[0]))
res := C.secp256k1_pubkey_scalar_mul(context, pointPtr, scalarPtr)