brontide: refer directly to the curve object in btcec's global namespace
This commit modifies the `ecdh` function within the `brontide` package to refer directly to the global curve params object in the `bcec` package rather than reference it from the target public key. This changes fixes a class of panics that have been uncovered recently but *doesn’t* yet fix the root cause.
This commit is contained in:
parent
b4fff97d14
commit
fdaeab7c9b
@ -47,7 +47,7 @@ var (
|
||||
// the sha256 of the compressed shared point.
|
||||
func ecdh(pub *btcec.PublicKey, priv *btcec.PrivateKey) []byte {
|
||||
s := &btcec.PublicKey{}
|
||||
x, y := pub.Curve.ScalarMult(pub.X, pub.Y, priv.D.Bytes())
|
||||
x, y := btcec.S256().ScalarMult(pub.X, pub.Y, priv.D.Bytes())
|
||||
s.X = x
|
||||
s.Y = y
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user