batchhasher

package
v0.0.0-...-5dd4785 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 6

Documentation

Index

Constants

View Source
const (
	HASH_LENGTH  = 243
	STATE_LENGTH = 3 * HASH_LENGTH
)
View Source
const (
	CURLP81_HASH_LENGTH = 243
	CURLP81_ROUNDS      = 81
)
View Source
const (
	BatchedHasherQueueSize = 500
)
View Source
const (
	NUMBER_OF_TRITS_IN_A_TRYTE = 3
)

Variables

View Source
var (
	BatchedHasherCount = runtime.NumCPU() * 2
)
View Source
var (
	TRUTH_TABLE = trinary.Trits{1, 0, -1, 2, 1, -1, 0, 2, -1, 1, 0}
)

Functions

This section is empty.

Types

type BCTCurl

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

func NewBCTCurl

func NewBCTCurl(hashLength int, numberOfRounds int, batchSize int) *BCTCurl

func (*BCTCurl) Absorb

func (this *BCTCurl) Absorb(bcTrits ternary_mux.BCTrits)

func (*BCTCurl) Reset

func (this *BCTCurl) Reset()

func (*BCTCurl) Squeeze

func (this *BCTCurl) Squeeze(tritCount int) ternary_mux.BCTrits

func (*BCTCurl) Transform

func (this *BCTCurl) Transform()

type BatchHasher

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

func NewBatchHasher

func NewBatchHasher(hashLength int, rounds int) (result *BatchHasher)

func (*BatchHasher) GetBatchSize

func (this *BatchHasher) GetBatchSize() int

func (*BatchHasher) GetPendingQueueSize

func (this *BatchHasher) GetPendingQueueSize() int

func (*BatchHasher) GetWorkerCount

func (this *BatchHasher) GetWorkerCount() int

func (*BatchHasher) Hash

func (this *BatchHasher) Hash(trits trinary.Trits) trinary.Trits

type Curl

type Curl struct {
	Hash
	// contains filtered or unexported fields
}

func NewCurl

func NewCurl(hashLength int, rounds int) *Curl

func (*Curl) Absorb

func (curl *Curl) Absorb(trits trinary.Trits, offset int, length int)

func (*Curl) Initialize

func (curl *Curl) Initialize()

func (*Curl) InitializeCurl

func (curl *Curl) InitializeCurl(trits trinary.Trits, length int, rounds int)

func (*Curl) Reset

func (curl *Curl) Reset()

func (*Curl) Squeeze

func (curl *Curl) Squeeze(resp trinary.Trits, offset int, length int) trinary.Trits

func (*Curl) Transform

func (curl *Curl) Transform()

type Hash

type Hash interface {
	Initialize()
	InitializeCurl(trits *[]int8, length int, rounds int)
	Reset()
	Absorb(trits *[]int8, offset int, length int)
	Squeeze(resp []int8, offset int, length int) []int
}

Jump to

Keyboard shortcuts

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