thex

package module
v0.0.0-...-4770eb8 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: GPL-3.0 Imports: 2 Imported by: 2

Documentation

Overview

Package thex implements hash tree computation as defined in the following: http://web.archive.org/web/20080316033726/http://www.open-content.net/specs/draft-jchapweske-thex-02.html R. C. Merkle, A digital signature based on a conventional encryption function, Crypto '87

thex is hash algorithm agnostic, New returns a new hash.Hash interface with a the hash.Hash argument as the internal algorithm.

Do not directly pass the data being hashed, write data chunks prepended with a 0x00 byte to an external hash function, and write the resulting digests to the tree. The recommended chunk size is 1024 bytes.

thex prepends each leaf hash with an 0x01 byte. This is to decrease the chance of collisions between external hashes and internal node hashes.

Because Write takes hash digests rather than chunks of data, intermediate node levels may be verified as well, Just write a complete row of intermediate node digests and call Sum().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(digest hash.Hash) hash.Hash

New returns a new hash.Hash that computes the root of a row of tree leaves. The digest argument is the hash.Hash that will be used to process the tree.

Types

This section is empty.

Jump to

Keyboard shortcuts

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