curl

package
v0.0.0-...-b10619e Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package curl implements the BCT Curl hashing function computing multiple Curl hashes in parallel.

Index

Constants

View Source
const (
	// StateSize is the size of the Curl hash function.
	StateSize = consts.HashTrinarySize * 3

	// NumRounds is the number of rounds in a Curl transform.
	NumRounds = 81
)
View Source
const MaxBatchSize = bits.UintSize

MaxBatchSize is the maximum number of Curl hashes that can be computed in one batch.

Variables

This section is empty.

Functions

This section is empty.

Types

type Curl

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

Curl is the BCT version of the Curl hashing function.

func NewCurlP81

func NewCurlP81() *Curl

NewCurlP81 returns a new BCT Curl-P-81.

func (*Curl) Absorb

func (c *Curl) Absorb(src []trinary.Trits, tritsCount int) error

Absorb fills the states of the sponge with src; each element of src must have the length tritsCount. The value tritsCount has to be a multiple of HashTrinarySize.

func (*Curl) Clone

func (c *Curl) Clone() *Curl

Clone returns a deep copy of the current BCT Curl instance.

func (*Curl) CopyState

func (c *Curl) CopyState(l, h []uint)

CopyState copies the content of the Curl state buffer into l and h.

func (*Curl) Reset

func (c *Curl) Reset()

Reset the internal state of the BCT Curl instance.

func (*Curl) Squeeze

func (c *Curl) Squeeze(dst []trinary.Trits, tritsCount int) error

Squeeze squeezes out trits of the given length. The value tritsCount has to be a multiple of HashTrinarySize.

type SpongeDirection

type SpongeDirection int

SpongeDirection indicates the direction trits are flowing through the sponge.

const (
	// SpongeAbsorbing indicates that the sponge is absorbing input.
	SpongeAbsorbing SpongeDirection = iota
	// SpongeSqueezing indicates that the sponge is being squeezed.
	SpongeSqueezing
)

Directories

Path Synopsis
asm module

Jump to

Keyboard shortcuts

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