Documentation ¶
Index ¶
- Variables
- func CreateAddress(b []byte, nonce uint64) []byte
- func Decrypt(prv *ecdsa.PrivateKey, ct []byte) ([]byte, error)
- func Ecrecover(data []byte) []byte
- 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 IndexOf(slice []string, value string) int64
- func MnemonicDecode(wordsar []string) string
- func MnemonicEncode(message string) []string
- func Ripemd160(data []byte) []byte
- func Sha256(data []byte) []byte
- func Sha3(data []byte) []byte
- func SigToPub(hash, sig []byte) *ecdsa.PublicKey
- func Sign(hash []byte, prv *ecdsa.PrivateKey) (sig []byte, err error)
- func ToECDSA(prv []byte) *ecdsa.PrivateKey
- func ToECDSAPub(pub []byte) *ecdsa.PublicKey
- type BitCurve
- func (BitCurve *BitCurve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
- func (BitCurve *BitCurve) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
- func (BitCurve *BitCurve) GenerateKey(rand io.Reader) (priv []byte, x, y *big.Int, err error)
- func (BitCurve *BitCurve) IsOnCurve(x, y *big.Int) bool
- func (BitCurve *BitCurve) Marshal(x, y *big.Int) []byte
- func (BitCurve *BitCurve) Params() *elliptic.CurveParams
- func (BitCurve *BitCurve) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
- func (BitCurve *BitCurve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)
- func (BitCurve *BitCurve) Unmarshal(data []byte) (x, y *big.Int)
- type DBKeyStore
- type FileKeyStore
- type KeyManager
- func (k *KeyManager) Address() []byte
- func (k *KeyManager) Export(dir string) error
- func (k *KeyManager) Init(session string, cursor int, force bool) error
- func (k *KeyManager) InitFromSecretsFile(session string, cursor int, secretsfile string) error
- func (k *KeyManager) InitFromString(session string, cursor int, secrets string) error
- func (k *KeyManager) KeyPair() *KeyPair
- func (k *KeyManager) KeyRing() *KeyPair
- func (k *KeyManager) PrivateKey() []byte
- func (k *KeyManager) PublicKey() []byte
- func (k *KeyManager) SetCursor(cursor int) error
- type KeyPair
- type KeyRing
- func NewGeneratedKeyRing(len int) *KeyRing
- func NewKeyRing() *KeyRing
- func NewKeyRingFromBytes(data []byte) (*KeyRing, error)
- func NewKeyRingFromFile(secfile string) (*KeyRing, error)
- func NewKeyRingFromSecrets(secs [][]byte) (*KeyRing, error)
- func NewKeyRingFromString(content string) (*KeyRing, error)
- type KeyStore
Constants ¶
This section is empty.
Variables ¶
var MnemonicWords []string = []string{}/* 1626 elements not displayed */
Functions ¶
func CreateAddress ¶
Creates an ethereum 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 IndexOf ¶
TODO: See if we can refactor this into a shared util lib if we need it multiple times
func MnemonicDecode ¶
func MnemonicEncode ¶
func ToECDSA ¶
func ToECDSA(prv []byte) *ecdsa.PrivateKey
New methods using proper ecdsa keys from the stdlib
func ToECDSAPub ¶
Types ¶
type BitCurve ¶
type BitCurve struct { P *big.Int // the order of the underlying field N *big.Int // the order of the base point B *big.Int // the constant of the BitCurve equation Gx, Gy *big.Int // (x,y) of the base point BitSize int // the size of the underlying field }
A BitCurve represents a Koblitz Curve with a=0. See http://www.hyperelliptic.org/EFD/g1p/auto-shortw.html
func S160 ¶
func S160() *BitCurve
S160 returns a BitCurve which implements secp160k1 (see SEC 2 section 2.4.1)
func S192 ¶
func S192() *BitCurve
S192 returns a BitCurve which implements secp192k1 (see SEC 2 section 2.5.1)
func S224 ¶
func S224() *BitCurve
S224 returns a BitCurve which implements secp224k1 (see SEC 2 section 2.6.1)
func S256 ¶
func S256() *BitCurve
S256 returns a BitCurve which implements secp256k1 (see SEC 2 section 2.7.1)
func (*BitCurve) GenerateKey ¶
TODO: double check if it is okay GenerateKey returns a public/private key pair. The private key is generated using the given reader, which must return random data.
func (*BitCurve) Marshal ¶
Marshal converts a point into the form specified in section 4.3.6 of ANSI X9.62.
func (*BitCurve) Params ¶
func (BitCurve *BitCurve) Params() *elliptic.CurveParams
func (*BitCurve) ScalarBaseMult ¶
ScalarBaseMult returns k*G, where G is the base point of the group and k is an integer in big-endian form.
func (*BitCurve) ScalarMult ¶
TODO: double check if it is okay ScalarMult returns k*(Bx,By) where k is a number in big-endian form.
type DBKeyStore ¶
type DBKeyStore struct {
// contains filtered or unexported fields
}
type FileKeyStore ¶
type FileKeyStore struct {
// contains filtered or unexported fields
}
type KeyManager ¶
type KeyManager struct {
// contains filtered or unexported fields
}
func NewDBKeyManager ¶
func NewDBKeyManager(db ethutil.Database) *KeyManager
func NewFileKeyManager ¶
func NewFileKeyManager(basedir string) *KeyManager
func (*KeyManager) Address ¶
func (k *KeyManager) Address() []byte
func (*KeyManager) Export ¶
func (k *KeyManager) Export(dir string) error
func (*KeyManager) InitFromSecretsFile ¶
func (k *KeyManager) InitFromSecretsFile(session string, cursor int, secretsfile string) error
func (*KeyManager) InitFromString ¶
func (k *KeyManager) InitFromString(session string, cursor int, secrets string) error
func (*KeyManager) KeyPair ¶
func (k *KeyManager) KeyPair() *KeyPair
func (*KeyManager) KeyRing ¶
func (k *KeyManager) KeyRing() *KeyPair
func (*KeyManager) PrivateKey ¶
func (k *KeyManager) PrivateKey() []byte
func (*KeyManager) PublicKey ¶
func (k *KeyManager) PublicKey() []byte
func (*KeyManager) SetCursor ¶
func (k *KeyManager) SetCursor(cursor int) error
type KeyPair ¶
type KeyPair struct { PrivateKey []byte PublicKey []byte // contains filtered or unexported fields }
func GenerateNewKeyPair ¶
func GenerateNewKeyPair() *KeyPair
func NewKeyPairFromSec ¶
type KeyRing ¶
type KeyRing struct {
// contains filtered or unexported fields
}
func NewGeneratedKeyRing ¶
func NewKeyRing ¶
func NewKeyRing() *KeyRing