reference

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package reference is a simple nonconcurrent reference implementation for hashsize segment based Binary Merkle tree hash on arbitrary but fixed maximum chunksize n where 0 <= n <= 4096

This implementation does not take advantage of any paralellisms and uses far more memory than necessary, but it is easy to see that it is correct. It can be used for generating test cases for optimized implementations. There is extra check on reference hasher correctness in bmt_test.go * TestRefHasher * testBMTHasherCorrectness function

Package reference is a simple nonconcurrent reference implementation of the BMT hash

This implementation does not take advantage of any paralellisms and uses far more memory than necessary, but it is easy to see that it is correct. It can be used for generating test cases for optimized implementations. There is extra check on reference hasher correctness in reference_test.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RefHasher

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

RefHasher is the non-optimized easy-to-read reference implementation of BMT.

func NewRefHasher

func NewRefHasher(h hash.Hash, count int) *RefHasher

NewRefHasher returns a new RefHasher.

func (*RefHasher) Hash

func (rh *RefHasher) Hash(data []byte) ([]byte, error)

Hash returns the BMT hash of the byte slice.

Jump to

Keyboard shortcuts

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