tz

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Overview

Package tz contains Tillich-Zemor 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 Inv

func Inv(a *sl2) (b *sl2)

Inv returns inverse of a in GL_2(GF(2^127))

func New

func New() *digest

New returns a new hash.Hash computing the Tillich-Zémor checksum.

func SubtractL

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

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

func SubtractR

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

SubtractR returns hash a, such that Concat(a, b) == c This is possible, because Tillich-Zemor 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

type GF127 = gf127.GF127

Jump to

Keyboard shortcuts

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