cuckoo

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: ISC Imports: 9 Imported by: 0

Documentation

Overview

Copyright (c) 2017-2018 The qitmeer developers

Copyright (c) 2017-2018 The qitmeer developers cuckoo cpu mining from network

Index

Constants

View Source
const (
	ProofSize = 42 //ProofSize is the number of nonces and cycles. the (even) length of the cycle to be found. a minimum of 12 is recommended.

	Edgebits = 24 //the 2-log of the graph size,which is the size in bits of the node identifiers. the size of the edge indices in the Cuckoo Cycle graph.
	//Edgebits  = 29
	Nedge = 1 << Edgebits //number of edges:

	Easiness = nnode * 50 / 100 //

)

Variables

This section is empty.

Functions

func SipHashKey added in v0.10.1

func SipHashKey(sipkey []byte) [4]uint64

func Sipnode

func Sipnode(h *siphash.SipHash, edge, uorv uint64, shift bool, edgemask uint64) uint64

func Uint32ToBytes

func Uint32ToBytes(v []uint32) []byte

HashToBig converts a hash.Hash into a big.Int that can be used to perform math comparisons.

func VerifyCuckaroo

func VerifyCuckaroo(sipkey []byte, nonces []uint32, edgeBits uint) error

Verify cuckaroo nonces.

func VerifyCuckaroom added in v0.10.1

func VerifyCuckaroom(sipHashKeys [4]uint64, nonces []uint32, edgeBits uint) error

Verify verifies the Cuckaroom context.

func VerifyCuckatoo

func VerifyCuckatoo(sipkey []byte, nonces []uint32, edgeBits uint) error

Verify cuckoo nonces.

Types

type Cuckoo

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

Cuckoo is struct for cuckoo miner.

func NewCuckoo

func NewCuckoo() *Cuckoo

NewCuckoo returns Cuckoo struct to do PoW.

func (*Cuckoo) PoW

func (c *Cuckoo) PoW(siphashKey []byte) ([]uint32, bool)

PoW does PoW with hash, which is the key for siphash.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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