func (p *privateKeyImpl) InternalKey() *btcec.PrivateKey {
	return p.k
}
InternalKey gets the internal key associated with a private key
package crypto
import (
	"encoding/hex"
	"errors"
	"fmt"
	"github.com/btcsuite/btcd/btcec"
	"github.com/btcsuite/btcutil/base58"
	"github.com/libonomy/libonomy-p2p/log"
)
type Key interface {
	String() string  
	Bytes() []byte   
	Pretty() string  
}
type PrivateKey interface {
	Key
	GetPublicKey() PublicKey  
	Sign([]byte) ([]byte, error)
	Decrypt(in []byte) ([]byte, error)
	InternalKey() *btcec.PrivateKey
}
type PublicKey interface {  
	Key
	Verify(data []byte, sig []byte) (bool, error)
	VerifyString(data []byte, sig string) (bool, error)
	Encrypt(in []byte) ([]byte, error)
	InternalKey() *btcec.PublicKey
}
type publicKeyImpl struct {
	k *btcec.PublicKey
}
type privateKeyImpl struct {
	k *btcec.PrivateKey
}
func GenerateKeyPair() (PrivateKey, PublicKey, error) {
	privKey, err := btcec.NewPrivateKey(btcec.S256())
	if err != nil {
		return nil, nil, err
	}
	return &privateKeyImpl{privKey}, &publicKeyImpl{privKey.PubKey()}, nil
}
func NewPrivateKey(data []byte) (PrivateKey, error) {
	if len(data) != 32 {
		return nil, errors.New("expected 32 bytes input")
	}
	privk, _ := btcec.PrivKeyFromBytes(btcec.S256(), data)
	return &privateKeyImpl{privk}, nil
}
func NewPrivateKeyFromString(s string) (PrivateKey, error) {
	data := base58.Decode(s)
	return NewPrivateKey(data)
}