No description
Find a file
2026-02-27 18:41:00 +03:00
.github/workflows go.mod: upgrade to Go 1.25 min 2026-02-19 21:53:58 +03:00
cmd cmd/homo: use any instead of interface{} 2023-05-17 19:22:10 +03:00
gf127 *: don't use math/rand 2024-08-19 23:07:35 +03:00
tz *: apply make modernize 2026-02-27 18:32:06 +03:00
.gitignore workflows: reuse org-wide linter workflow 2024-09-10 21:01:20 +03:00
auto.sh Initial 2018-12-29 16:04:17 +03:00
benchmark benchmark: fix shellcheck issues 2022-03-21 12:30:08 +03:00
Dockerfile Update alpine image, fixup for Makefile, fixup for benchmark 2020-01-16 11:30:46 +03:00
go.mod go.mod: upgrade golang.org/x/sys dependency to v0.41.0 2026-02-19 21:53:58 +03:00
go.sum go.mod: upgrade golang.org/x/sys dependency to v0.41.0 2026-02-19 21:53:58 +03:00
LICENSE LICENSE: change to Apache 2.0 2023-05-26 12:43:26 +03:00
Makefile Makefile: add modernize target 2026-02-27 18:31:20 +03:00
README.md README: add badges 2024-08-21 11:21:14 +03:00

codecov Report GitHub release (latest SemVer) License

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 they are 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 concatenable: hash sum of data can be calculated based on hashes of chunks.

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

Benchmarks

go vs AVX vs AVX2 version

BenchmarkSum/AVX_digest-8             308       3889484 ns/op          25.71 MB/s         5 allocs/op
BenchmarkSum/AVXInline_digest-8       457       2455437 ns/op          40.73 MB/s         5 allocs/op
BenchmarkSum/AVX2_digest-8            399       3031102 ns/op          32.99 MB/s         3 allocs/op
BenchmarkSum/AVX2Inline_digest-8      602       2077719 ns/op          48.13 MB/s         3 allocs/op
BenchmarkSum/PureGo_digest-8           68       17795480 ns/op          5.62 MB/s         5 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