sponge

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package sponge provides an interface for the sponge functions in IOTA.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SpongeFunction

type SpongeFunction interface {
	Squeeze(length int) (Trits, error)
	MustSqueeze(length int) Trits
	SqueezeTrytes(length int) (Trytes, error)
	MustSqueezeTrytes(length int) Trytes
	Absorb(in Trits) error
	AbsorbTrytes(in Trytes) error
	MustAbsorbTrytes(in Trytes)
	Reset()
	Clone() SpongeFunction
}

SpongeFunction is a hash function using the sponge construction.

func GetSpongeFunc

func GetSpongeFunc(spongeFunc []SpongeFunction, defaultSpongeFuncCreator ...SpongeFunctionCreator) SpongeFunction

GetSpongeFunc checks if a hash function was given, otherwise uses defaultSpongeFuncCreator. Panics if none given.

type SpongeFunctionCreator

type SpongeFunctionCreator func() SpongeFunction

Jump to

Keyboard shortcuts

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