iotex-core: github.com/iotexproject/iotex-core/crypto Index | Files

package crypto

import "github.com/iotexproject/iotex-core/crypto"

Index

Package Files

cryptosort.go merkle.go

Variables

var (
    // CryptoSeed is a hardcoded seed that will be replaced by a seed produced dynamically.
    CryptoSeed = []byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef}
)

func Sort Uses

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

Sort sorts a given slices of hashes cryptographically using hash function

func SortCandidates Uses

func SortCandidates(candidates []string, epochNum uint64, cryptoSeed []byte)

SortCandidates sorts a given slices of hashes cryptographically using hash function

type Merkle Uses

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

Merkle tree struct

func NewMerkleTree Uses

func NewMerkleTree(leaves []hash.Hash256) *Merkle

NewMerkleTree creates a merkle tree given hashed leaves

func (*Merkle) HashTree Uses

func (mk *Merkle) HashTree() hash.Hash256

HashTree calculates the root hash of a merkle tree

Package crypto imports 4 packages (graph) and is imported by 4 packages. Updated 2019-08-18. Refresh now. Tools for package owners.