crypto

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FnvPrime = 0x01000193
)

Variables

This section is empty.

Functions

func Blake2b

func Blake2b(data, personal []byte, size int) []byte

func Blake2b256

func Blake2b256(data []byte) []byte

func CShake256 added in v0.4.3

func CShake256(data, personal []byte, size int) []byte

func Fnv1Uint64 added in v0.3.2

func Fnv1Uint64(u, v uint64) uint64

func FnvHash

func FnvHash(mix []uint32, data []uint32)

fnvHash mixes in data into mix using the ethash fnv method.

func Keccak256

func Keccak256(b []byte) []byte

func Keccak512

func Keccak512(b []byte) []byte

func KeccakF800

func KeccakF800(state *[25]uint32)

func SipBlock48 added in v0.4.1

func SipBlock48(siphashKeys [4]uint64, edge uint64) uint64

func SipNode24 added in v0.4.1

func SipNode24(edgeMask uint64, siphashKeys [4]uint64, edge, uorv uint64) uint64

func SipNode24Legacy added in v0.4.1

func SipNode24Legacy(edgeMask uint64, siphashKeys [4]uint64, edge, uorv uint64) uint64

Types

type Hasher

type Hasher func(dest []byte, data []byte)

hasher is a repetitive hasher allowing the same hash data structures to be reused between hash runs instead of requiring new ones to be created.

func NewKeccak256Hasher

func NewKeccak256Hasher() Hasher

func NewKeccak512Hasher

func NewKeccak512Hasher() Hasher

type SipBlockFunc added in v0.4.1

type SipBlockFunc func([4]uint64, uint64) uint64

type SipHasher added in v0.3.3

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

func NewSipHasher added in v0.3.3

func NewSipHasher(v0, v1, v2, v3 uint64) *SipHasher

func (*SipHasher) Hash24 added in v0.3.3

func (h *SipHasher) Hash24(nonce uint64)

func (*SipHasher) Hash48 added in v0.4.1

func (h *SipHasher) Hash48(nonce uint64)

func (*SipHasher) SipRound added in v0.3.3

func (h *SipHasher) SipRound()

func (*SipHasher) XorLanes added in v0.3.3

func (h *SipHasher) XorLanes() uint64

type SipNodeFunc added in v0.4.1

type SipNodeFunc func(uint64, [4]uint64, uint64, uint64) uint64

type Xoshiro256PlusPlusHasher added in v0.4.3

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

func NewXoshiro256PlusPlusHasher added in v0.4.3

func NewXoshiro256PlusPlusHasher(s0, s1, s2, s3 uint64) Xoshiro256PlusPlusHasher

func (*Xoshiro256PlusPlusHasher) Next added in v0.4.3

func (h *Xoshiro256PlusPlusHasher) Next() uint64

Jump to

Keyboard shortcuts

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