tz

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 11

Documentation

Overview

Package tz contains Tillich-Zémor checksum implementations using different backends.

Copyright 2022 (c) NSPCC

Index

Constants

View Source
const (
	// Size is the size of a Tillich-Zémor hash sum in bytes.
	Size = 64
)

Variables

This section is empty.

Functions

func Concat

func Concat(hs [][]byte) ([]byte, error)

Concat performs combining of hashes based on homomorphic property.

func New

func New() hash.Hash

New returns a new hash.Hash computing the Tillich-Zémor checksum. The Hash also implements encoding.BinaryMarshaler and encoding.BinaryUnmarshaler to marshal and unmarshal the internal state of the hash.

func SubtractL added in v1.1.0

func SubtractL(c, a []byte) (b []byte, err error)

SubtractL returns hash b, such that Concat(a, b) == c This is possible, because Tillich-Zémor hash is actually a matrix which can be inversed.

func SubtractR added in v1.1.0

func SubtractR(c, b []byte) (a []byte, err error)

SubtractR returns hash a, such that Concat(a, b) == c This is possible, because Tillich-Zémor hash is actually a matrix which can be inversed.

func Sum

func Sum(data []byte) [Size]byte

Sum returns Tillich-Zémor checksum of data.

func Validate

func Validate(h []byte, hs [][]byte) (bool, error)

Validate checks if hashes in hs combined are equal to h.

Types

type GF127 added in v1.4.0

type GF127 = gf127.GF127

Jump to

Keyboard shortcuts

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