crypt

package
Version: v0.0.0-...-dcefb82 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2019 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NUMBER_OF_ROUNDSP27 = 27
	NUMBER_OF_ROUNDSP81 = 81
	HASH_LENGTH         = 243
	STATE_LENGTH        = 3 * HASH_LENGTH
)
View Source
const (
	BIT_HASH_LENGTH  = 384
	BYTE_HASH_LENGTH = BIT_HASH_LENGTH / 8
)

Variables

View Source
var (
	THREE = big.NewInt(3)
	ONE   = big.NewInt(1)
)
View Source
var (
	TRUTH_TABLE = []int{1, 0, -1, 2, 1, -1, 0, 2, -1, 1, 0}
)

Functions

func IsValidPoW

func IsValidPoW(hsh []byte, mwm int) bool

func RunHashCurl

func RunHashCurl(trits []int) []int

func RunHashKerl

func RunHashKerl(trits []int) []int

Types

type Curl

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

func (*Curl) Absorb

func (curl *Curl) Absorb(trits []int, offset int, length int)

func (*Curl) Initialize

func (curl *Curl) Initialize()

func (*Curl) InitializeCurl

func (curl *Curl) InitializeCurl(trits []int, length int, rounds int)

func (*Curl) Reset

func (curl *Curl) Reset()

func (*Curl) Squeeze

func (curl *Curl) Squeeze(resp []int, offset int, length int) []int

func (*Curl) Transform

func (curl *Curl) Transform()

type Hash

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

type Kerl

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

func (*Kerl) Absorb

func (kerl *Kerl) Absorb(trits []int, offset int, length int)

func (*Kerl) Initialize

func (kerl *Kerl) Initialize()

func (*Kerl) Reset

func (kerl *Kerl) Reset()

func (*Kerl) Squeeze

func (kerl *Kerl) Squeeze(trits []int, offset int, length int) []int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL