From 6fdd0893c3ebf57e5a9ba2af569c595c859ab902 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 15 Apr 2016 11:06:57 +0200 Subject: all: fix go vet warnings --- crypto/crypto.go | 4 ++-- crypto/ecies/ecies.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crypto') diff --git a/crypto/crypto.go b/crypto/crypto.go index b24d08010..85f097095 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -107,7 +107,7 @@ func ToECDSAPub(pub []byte) *ecdsa.PublicKey { return nil } x, y := elliptic.Unmarshal(secp256k1.S256(), pub) - return &ecdsa.PublicKey{secp256k1.S256(), x, y} + return &ecdsa.PublicKey{Curve: secp256k1.S256(), X: x, Y: y} } func FromECDSAPub(pub *ecdsa.PublicKey) []byte { @@ -189,7 +189,7 @@ func SigToPub(hash, sig []byte) (*ecdsa.PublicKey, error) { } x, y := elliptic.Unmarshal(secp256k1.S256(), s) - return &ecdsa.PublicKey{secp256k1.S256(), x, y}, nil + return &ecdsa.PublicKey{Curve: secp256k1.S256(), X: x, Y: y}, nil } func Sign(hash []byte, prv *ecdsa.PrivateKey) (sig []byte, err error) { diff --git a/crypto/ecies/ecies.go b/crypto/ecies/ecies.go index ee4285617..86a70261d 100644 --- a/crypto/ecies/ecies.go +++ b/crypto/ecies/ecies.go @@ -60,7 +60,7 @@ type PublicKey struct { // Export an ECIES public key as an ECDSA public key. func (pub *PublicKey) ExportECDSA() *ecdsa.PublicKey { - return &ecdsa.PublicKey{pub.Curve, pub.X, pub.Y} + return &ecdsa.PublicKey{Curve: pub.Curve, X: pub.X, Y: pub.Y} } // Import an ECDSA public key as an ECIES public key. @@ -83,7 +83,7 @@ type PrivateKey struct { func (prv *PrivateKey) ExportECDSA() *ecdsa.PrivateKey { pub := &prv.PublicKey pubECDSA := pub.ExportECDSA() - return &ecdsa.PrivateKey{*pubECDSA, prv.D} + return &ecdsa.PrivateKey{PublicKey: *pubECDSA, D: prv.D} } // Import an ECDSA private key as an ECIES private key. -- cgit