utils

package
v0.0.0-...-d238806 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: GPL-2.0, GPL-3.0 Imports: 10 Imported by: 14

Documentation

Overview

Copyright 2013-present wemeetagain https://github.com/wemeetagain/go-hdwallet Copyright 2019-present Varunram Ganesh

Index

Constants

This section is empty.

Variables

Functions

func AddPrivKeys

func AddPrivKeys(k1, k2 []byte) []byte

func AddPubKeys

func AddPubKeys(k1, k2 []byte) []byte

func BytesToNum

func BytesToNum(byteString []byte) *big.Int

func Compress

func Compress(x, y *big.Int) []byte

func DoubleSha256

func DoubleSha256(data []byte) []byte

func Expand

func Expand(key []byte) (*big.Int, *big.Int)

2.3.4 of SEC1 - http://www.secg.org/index.php?action=secg,docs_secg

func Hash160

func Hash160(data []byte) []byte

func NewPrivateKey

func NewPrivateKey() (*big.Int, error)

func PrivToPub

func PrivToPub(key []byte) []byte

func PubkeyPointsFromPrivkey

func PubkeyPointsFromPrivkey(privkey *big.Int) (*big.Int, *big.Int)

func Sha256

func Sha256(inputs ...[]byte) []byte

func Sha256File

func Sha256File(fileName string) ([]byte, error)

Types

type Elgamal

type Elgamal struct {
	X Point // since each one of these is a curve point
	Y Point // since each one of these is a curve point
}

func (*Elgamal) Set

func (e *Elgamal) Set(x, y Point)

type Point

type Point struct {
	X *big.Int
	Y *big.Int
}

func Add

func Add(x1, x2 Point) Point

func PointFromPrivkey

func PointFromPrivkey(privkey *big.Int) Point

func ScalarBaseMult

func ScalarBaseMult(a []byte) Point

func ScalarMult

func ScalarMult(P Point, a []byte) Point

func Sub

func Sub(x1, x2 Point) Point

func (*Point) Add

func (p *Point) Add(x1, x2 Point)

func (*Point) AddCoords

func (p *Point) AddCoords(x1, y1, x2, y2 *big.Int)

func (*Point) Bytes

func (p *Point) Bytes() []byte

func (*Point) Cmp

func (p *Point) Cmp(a Point) bool

func (*Point) ScalarMult

func (p *Point) ScalarMult(a []byte)

func (*Point) Set

func (p *Point) Set(x, y *big.Int)

Jump to

Keyboard shortcuts

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