cuckoo

package
v0.0.0-...-41ad6a2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2016 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SIZESHIFT uint64 = 20
	PROOFSIZE uint64 = 42
	SIZE      uint64 = 1 << SIZESHIFT
	HALFSIZE  uint64 = SIZE / 2
	NODEMASK  uint64 = HALFSIZE - 1
)

Variables

This section is empty.

Functions

func EncodeCuckooJSON

func EncodeCuckooJSON(cuck CuckooJSON) ([]byte, error)

func VerifyJSON

func VerifyJSON(cuck CuckooJSON) bool

Types

type Cuckoo

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

func NewCuckoo

func NewCuckoo(header []byte) *Cuckoo

func NewCuckooSHA

func NewCuckooSHA(hdrkey [sha256.Size]byte) *Cuckoo

func (*Cuckoo) Sipedge

func (self *Cuckoo) Sipedge(nonce uint64) *Edge

func (*Cuckoo) Sipnode

func (self *Cuckoo) Sipnode(nonce uint64, uorv uint32) uint64

generate edge in cuckoo graph

func (*Cuckoo) Verify

func (self *Cuckoo) Verify(nonces []uint64, easiness uint64) bool

verify that (ascending) nonces, all less than easiness, form a cycle in graph

type CuckooJSON

type CuckooJSON struct {
	Parameter map[string]uint64 `json:"parameters"`
	InputData []byte            `json:"header"` //sha256 bytes
	Cycle     []uint64          `json:"cycle"`
}

func DecodeCuckooJSON

func DecodeCuckooJSON(jsonBlob []byte) (*CuckooJSON, error)

type Edge

type Edge struct {
	U uint64
	V uint64
}

func (*Edge) HashCode

func (self *Edge) HashCode() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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