diff --git a/crypto/crypto.go b/crypto/crypto.go index 453b1c8e8..178ee471e 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -49,9 +49,13 @@ func GenKeyPair() ([]byte, PubKey, error) { return nil, *mPubKey, err } + privkey := make([]byte, util.PRIVATEKEYLEN) + copy(privkey[util.PRIVATEKEYLEN-len(privateD):], privateD) + mPubKey.X = new(big.Int).Set(X) mPubKey.Y = new(big.Int).Set(Y) - return privateD, *mPubKey, nil + + return privkey, *mPubKey, nil } func Sign(privateKey []byte, data []byte) ([]byte, error) {