tz

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: GPL-3.0 Imports: 4 Imported by: 15

Documentation

Overview

Copyright 2018 (c) NSPCC

Package tz implements general Tillich-Zemo

Index

Constants

This section is empty.

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 added in v1.1.0

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

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

func New

func New() hash.Hash

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

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-Zemor 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-Zemor hash is actually a matrix which can be inversed.

func Sum

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

Sum returns Tillich-Zémor checksum of data.

func SumAVX added in v1.1.0

func SumAVX(data []byte) [hashSize]byte

Sum returnz Tillich-Zémor checksum of data. It uses only AVX instructions (no AVX2).

func Validate

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

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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