bct

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 4 Imported by: 9

Documentation

Overview

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

Index

Constants

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.

Jump to

Keyboard shortcuts

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