aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ecies/ecies.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-09-30 01:37:44 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-11-30 20:43:32 +0800
commitc8ad64f33cd04fc10ac6681260ea06e464908c91 (patch)
treebd48055c50b57e2b17ca0bde4e9e5ae9ba7ca5ce /crypto/ecies/ecies.go
parent27a50c8f4bc69f98e20db361859bfbb6cf371c00 (diff)
downloaddexon-c8ad64f33cd04fc10ac6681260ea06e464908c91.tar.gz
dexon-c8ad64f33cd04fc10ac6681260ea06e464908c91.tar.zst
dexon-c8ad64f33cd04fc10ac6681260ea06e464908c91.zip
crypto, crypto/ecies, crypto/secp256k1: libsecp256k1 scalar mult
thanks to Felix Lange (fjl) for help with design & impl
Diffstat (limited to 'crypto/ecies/ecies.go')
-rw-r--r--crypto/ecies/ecies.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/ecies/ecies.go b/crypto/ecies/ecies.go
index a3b520dd5..65dc5b38b 100644
--- a/crypto/ecies/ecies.go
+++ b/crypto/ecies/ecies.go
@@ -125,6 +125,7 @@ func (prv *PrivateKey) GenerateShared(pub *PublicKey, skLen, macLen int) (sk []b
if skLen+macLen > MaxSharedKeyLength(pub) {
return nil, ErrSharedKeyTooBig
}
+
x, _ := pub.Curve.ScalarMult(pub.X, pub.Y, prv.D.Bytes())
if x == nil {
return nil, ErrSharedKeyIsPointAtInfinity