Documentation ¶
Index ¶
- Variables
- func CreateAddress(b common.Address, nonce uint64) common.Address
- func Decrypt(prv *ecdsa.PrivateKey, ct []byte) ([]byte, error)
- func Ecrecover(hash, sig []byte) ([]byte, error)
- func Encrypt(pub *ecdsa.PublicKey, message []byte) ([]byte, error)
- func FromECDSA(prv *ecdsa.PrivateKey) []byte
- func FromECDSAPub(pub *ecdsa.PublicKey) []byte
- func GenerateKey() (*ecdsa.PrivateKey, error)
- func HexToECDSA(hexkey string) (*ecdsa.PrivateKey, error)
- func IndexOf(slice []string, value string) int64
- func Keccak256(data ...[]byte) []byte
- func Keccak256Hash(data ...[]byte) (h common.Hash)
- func LoadECDSA(file string) (*ecdsa.PrivateKey, error)
- func MnemonicDecode(wordsar []string) string
- func MnemonicEncode(message string) []string
- func PubkeyToAddress(p ecdsa.PublicKey) common.Address
- func Ripemd160(data []byte) []byte
- func SaveECDSA(file string, key *ecdsa.PrivateKey) error
- func Sha256(data []byte) []byte
- func Sha3(data ...[]byte) []bytedeprecated
- func Sha3Hash(data ...[]byte) common.Hash
- func SigToPub(hash, sig []byte) (*ecdsa.PublicKey, error)
- func Sign(hash []byte, prv *ecdsa.PrivateKey) (sig []byte, err error)
- func ToECDSA(prv []byte) *ecdsa.PrivateKey
- func ToECDSAPub(pub []byte) *ecdsa.PublicKey
- func ValidateSignatureValues(v byte, r, s *big.Int, homestead bool) bool
- type KeyPair
Constants ¶
This section is empty.
Variables ¶
View Source
var MnemonicWords []string = []string{}/* 1630 elements not displayed */
Functions ¶
func CreateAddress ¶
Creates an expanse address given the bytes and the nonce
func FromECDSA ¶
func FromECDSA(prv *ecdsa.PrivateKey) []byte
func FromECDSAPub ¶
func GenerateKey ¶
func GenerateKey() (*ecdsa.PrivateKey, error)
func HexToECDSA ¶ added in v0.8.4
func HexToECDSA(hexkey string) (*ecdsa.PrivateKey, error)
HexToECDSA parses a secp256k1 private key.
func IndexOf ¶
TODO: See if we can refactor this into a shared util lib if we need it multiple times
func Keccak256Hash ¶ added in v1.4.4
func LoadECDSA ¶ added in v0.8.4
func LoadECDSA(file string) (*ecdsa.PrivateKey, error)
LoadECDSA loads a secp256k1 private key from the given file. The key data is expected to be hex-encoded.
func MnemonicDecode ¶
func MnemonicEncode ¶
func SaveECDSA ¶ added in v0.9.17
func SaveECDSA(file string, key *ecdsa.PrivateKey) error
SaveECDSA saves a secp256k1 private key to the given file with restrictive permissions. The key data is saved hex-encoded.
func ToECDSA ¶
func ToECDSA(prv []byte) *ecdsa.PrivateKey
New methods using proper ecdsa keys from the stdlib
func ToECDSAPub ¶
Types ¶
type KeyPair ¶
type KeyPair struct { PrivateKey []byte PublicKey []byte // contains filtered or unexported fields }
func GenerateNewKeyPair ¶
func GenerateNewKeyPair() *KeyPair
func NewKeyPairFromSec ¶
Directories ¶
Path | Synopsis |
---|---|
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
|
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202. |
Click to show internal directories.
Click to hide internal directories.