tz

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2018 (c) NSPCC

This file contains AVX implementation.

This file contains AVX2 implementation.

This file contains AVX2 implementation with inlined assembly calls.

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

func NewWith(impl Implementation) hash.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-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 Validate

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

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

Types

type Implementation added in v1.2.0

type Implementation int
const (
	AVX Implementation
	AVX2
	AVX2Inline
	PureGo
)

func (Implementation) String added in v1.2.0

func (impl Implementation) String() string

Jump to

Keyboard shortcuts

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