crypto

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 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

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

func Fnv1Uint64

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

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

func SipNode24

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

func SipNode24Legacy

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

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

type SipHasher

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

func NewSipHasher

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

func (*SipHasher) Hash24

func (h *SipHasher) Hash24(nonce uint64)

func (*SipHasher) Hash48

func (h *SipHasher) Hash48(nonce uint64)

func (*SipHasher) SipRound

func (h *SipHasher) SipRound()

func (*SipHasher) XorLanes

func (h *SipHasher) XorLanes() uint64

type SipNodeFunc

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

type Xoshiro256PlusPlusHasher

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

func NewXoshiro256PlusPlusHasher

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

func (*Xoshiro256PlusPlusHasher) Next

func (h *Xoshiro256PlusPlusHasher) Next() uint64

Jump to

Keyboard shortcuts

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