Skip to content

Commit 25eb9c8

Browse files
committed
accounts/scwallet: remove references to deprecated elliptic package (ethereum#28946)
1 parent 42d0a72 commit 25eb9c8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

accounts/scwallet/securechannel.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"bytes"
2121
"crypto/aes"
2222
"crypto/cipher"
23-
"crypto/elliptic"
2423
"crypto/rand"
2524
"crypto/sha256"
2625
"crypto/sha512"
@@ -72,11 +71,11 @@ func NewSecureChannelSession(card *pcsc.Card, keyData []byte) (*SecureChannelSes
7271
if err != nil {
7372
return nil, fmt.Errorf("could not unmarshal public key from card: %v", err)
7473
}
75-
secret, _ := key.Curve.ScalarMult(cardPublic.X, cardPublic.Y, key.D.Bytes())
74+
secret, _ := crypto.S256().ScalarMult(cardPublic.X, cardPublic.Y, key.D.Bytes())
7675
return &SecureChannelSession{
7776
card: card,
7877
secret: secret.Bytes(),
79-
publicKey: elliptic.Marshal(crypto.S256(), key.PublicKey.X, key.PublicKey.Y),
78+
publicKey: crypto.FromECDSAPub(&key.PublicKey),
8079
}, nil
8180
}
8281

0 commit comments

Comments
 (0)