cryptoutil

package
v0.0.0-...-2237e27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractRSVFromSignature

func ExtractRSVFromSignature(sig []byte) ([32]byte, [32]byte, uint8)

ExtractRSVFromSignature extracts the R,S,V from the signature

func GenerateKeyPair

func GenerateKeyPair() (common.Address, *ecdsa.PrivateKey)

GenerateKeyPair is a utility function to generate and format a new key pair for our use

func MnemonicToKeys

func MnemonicToKeys(mnemonic string) (*hdwallet.Wallet, error)

MnemonicToKeys takes a mnemonic and returns a pointer to a wallet

func Sign

func Sign(proof common.Hash, priv *ecdsa.PrivateKey) ([]byte, error)

Sign does all the necessary steps to correctly hash and sign an ethereum message

func SignHash

func SignHash(data string) ([]byte, string)

SignHash prefixes our string to hash with "\x19Ethereum Signed Message:\n32" and takes the keccack256 hash of it

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL