Tillich-Zémor hashing golang implementation
Find a file
fyrchik dd15c90530
Merge pull request #8 from nspcc-dev/pureGo
Add pure-go GF(2^127) implementation
2019-07-19 12:06:24 +03:00
.circleci Enable CircleCI (#2) 2019-01-03 13:26:32 +03:00
cmd Initial 2018-12-29 16:04:17 +03:00
gf127 Add test for marshalling/unmarshalling 2019-06-24 11:02:42 +03:00
gogf127 Add pure-go GF(2^127) implementation 2019-07-19 12:04:16 +03:00
tz Report benchmark results in MB/s 2019-07-10 12:07:54 +03:00
.gitignore Initial 2018-12-29 16:04:17 +03:00
auto.sh Initial 2018-12-29 16:04:17 +03:00
benchmark Initial 2018-12-29 16:04:17 +03:00
Dockerfile Initial 2018-12-29 16:04:17 +03:00
go.mod Rewrite tests (#3) 2019-05-29 14:10:17 +03:00
go.sum Rewrite tests (#3) 2019-05-29 14:10:17 +03:00
LICENSE Initial 2018-12-29 16:04:17 +03:00
Makefile Initial 2018-12-29 16:04:17 +03:00
README.md Report benchmark results in MB/s 2019-07-10 12:07:54 +03:00

Demo

asciicast

In project root:

# show help
make
# run auto demo
make auto

Homomorphic hashing in golang

Package tz containts pure-Go implementation of hashing function described by Tillich and Źemor in [1] .

There are existing implementations already (e.g. [2]), however it is written in C.

Package gf127 contains arithmetic in GF(2^127) with x^127+x^63+1 as reduction polynomial.

Description

It can be used instead of Merkle-tree for data-validation, because homomorphic hashes are concatable: hash sum of data can be calculated based on hashes of chunks.

The example of how it works can be seen in tests.

Benchmarks

AVX vs AVX2 version

BenchmarkAVX-8           500       3579980 ns/op      27.93 MB/s          64 B/op          4 allocs/op
BenchmarkAVX2-8          500       2997518 ns/op      33.36 MB/s          64 B/op          2 allocs/op

Contributing

At this moment, we do not accept contributions. Follow us.

Makefile

→ make
  Usage:

    make <target>

  Targets:

    attach   Attach to existing container
    auto     Auto Tillich-Zémor hasher demo
    down     Stop demo container
    help     Show this help prompt
    up       Run Tillich-Zémor hasher demo

Links

[1] https://link.springer.com/content/pdf/10.1007/3-540-48658-5_5.pdf

[2] https://github.com/srijs/hwsl2-core