ssz

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashTreeRoot

func HashTreeRoot(value interface{}, sszTyp types.SSZ) core.Root

HashTreeRoot the given value.

The value is expected to be a pointer to a type matching the SSZ definition that is used. Example:

sszTyp := zssz.GetSSZ((*MyStruct)(nil))
value := MyStruct{A: 123, B: false, C: []byte{42,13,37}}
root := HashTreeRoot(&value, sszTyp)

func InitZeroHashes added in v0.7.1

func InitZeroHashes(hashFn hashing.HashFn)

When the hash function changed, also re-initialize the precomputed zero-hashes with this hash-function. These precomputed hashes are used to complete merkle-trees efficiently to a power of 2, without unnecessary duplicate hashing of zeroes, or hashes of, or higher order, up to 32.

func SigningRoot

func SigningRoot(value interface{}, sszTyp types.SSZ) core.Root

SigningRoot the given value. If sszTyp is not a container, this function will just return the result of a regular HashTreeRoot.

The value is expected to be a pointer to a type matching the SSZ definition that is used. Example:

sszTyp := zssz.GetSSZ((*MyStruct)(nil))
value := MyStruct{A: 123, B: false, C: []byte{42,13,37}}
root := SigningRoot(&value, sszTyp)

Types

This section is empty.

Jump to

Keyboard shortcuts

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