crypto

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeyPair

func NewKeyPair() ([]byte, []byte, error)

NewKeyPair generates a new public/private key pair

func Sign

func Sign(priv []byte, msg []byte) []byte

Sign signs the msg

func Sort

func Sort(hashes [][]byte, nonce uint64) error

Sort sorts a given slices of hashes cryptographically using blake2b hash function

func Verify

func Verify(pub []byte, msg []byte, sig []byte) bool

Verify verifies the signature

Types

type Merkle

type Merkle struct {
	// contains filtered or unexported fields
}

Merkle tree struct

func NewMerkleTree

func NewMerkleTree(leaves []common.Hash32B) *Merkle

NewMerkleTree creates a merkle tree given hashed leaves

func (*Merkle) HashTree

func (mk *Merkle) HashTree() common.Hash32B

HashTree calculates the root hash of a merkle tree

Jump to

Keyboard shortcuts

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