Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeSecp256k1PrivateKey(data []byte) (*ecdsa.PrivateKey, error)
- func EncodeSecp256k1PrivateKey(k *ecdsa.PrivateKey) []byte
- func EncodeSecp256k1PublicKey(k *ecdsa.PublicKey) []byte
- func GenerateSecp256k1Key() (*ecdsa.PrivateKey, error)
- func GenerateSecpPrivateKeyFromString(privateKey string) (*ecdsa.PrivateKey, error)
- func LegacyKeccak256(data []byte) ([]byte, error)
- func NewEthereumAddress(p ecdsa.PublicKey) []byte
- func Secp256k1PrivateKeyFromBytes(data []byte) *ecdsa.PrivateKey
- type RecoverFunc
Constants ¶
View Source
const (
AddressSize = 20
)
Variables ¶
View Source
var ErrBadHashLength = errors.New("wrong block hash length")
Functions ¶
func DecodeSecp256k1PrivateKey ¶
func DecodeSecp256k1PrivateKey(data []byte) (*ecdsa.PrivateKey, error)
DecodeSecp256k1PrivateKey decodes raw ECDSA private key.
func EncodeSecp256k1PrivateKey ¶
func EncodeSecp256k1PrivateKey(k *ecdsa.PrivateKey) []byte
EncodeSecp256k1PrivateKey encodes raw ECDSA private key.
func EncodeSecp256k1PublicKey ¶
EncodeSecp256k1PublicKey encodes raw ECDSA public key in a 33-byte compressed format.
func GenerateSecp256k1Key ¶
func GenerateSecp256k1Key() (*ecdsa.PrivateKey, error)
GenerateSecp256k1Key generates an ECDSA private key using secp256k1 elliptic curve.
func GenerateSecpPrivateKeyFromString ¶
func GenerateSecpPrivateKeyFromString(privateKey string) (*ecdsa.PrivateKey, error)
GenerateSecp256k1Key generates an ECDSA private key using secp256k1 elliptic curve.
func LegacyKeccak256 ¶
func NewEthereumAddress ¶
func Secp256k1PrivateKeyFromBytes ¶
func Secp256k1PrivateKeyFromBytes(data []byte) *ecdsa.PrivateKey
Secp256k1PrivateKeyFromBytes returns an ECDSA private key based on the byte slice.
Types ¶
Click to show internal directories.
Click to hide internal directories.