{"id":13450048,"url":"https://github.com/minio/highwayhash","last_synced_at":"2025-05-13T15:09:49.491Z","repository":{"id":46192359,"uuid":"98917649","full_name":"minio/highwayhash","owner":"minio","description":"Native Go version of HighwayHash with optimized assembly implementations on Intel and ARM. Able to process over 10 GB/sec on a single core on Intel CPUs - https://en.wikipedia.org/wiki/HighwayHash","archived":false,"fork":false,"pushed_at":"2024-12-27T12:58:23.000Z","size":115,"stargazers_count":918,"open_issues_count":0,"forks_count":70,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-23T18:54:55.121Z","etag":null,"topics":["assembly","avx2","hash-functions","highway-hash","neon","plan9"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-31T18:29:23.000Z","updated_at":"2025-04-17T19:37:30.000Z","dependencies_parsed_at":"2024-04-10T05:38:38.583Z","dependency_job_id":"075cb6ce-f8cb-40dc-a37c-0f12caad90f2","html_url":"https://github.com/minio/highwayhash","commit_stats":{"total_commits":63,"total_committers":6,"mean_commits":10.5,"dds":"0.33333333333333337","last_synced_commit":"1a96f281b5c687cf18030f723e303c6093a3c3d0"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minio%2Fhighwayhash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minio%2Fhighwayhash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minio%2Fhighwayhash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minio%2Fhighwayhash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minio","download_url":"https://codeload.github.com/minio/highwayhash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253969241,"owners_count":21992262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assembly","avx2","hash-functions","highway-hash","neon","plan9"],"created_at":"2024-07-31T07:00:28.660Z","updated_at":"2025-05-13T15:09:44.469Z","avatar_url":"https://github.com/minio.png","language":"Go","funding_links":[],"categories":["Go","Erasure Coding and Hashing"],"sub_categories":[],"readme":"[![Godoc Reference](https://godoc.org/github.com/minio/highwayhash?status.svg)](https://godoc.org/github.com/minio/highwayhash)\n[![Build Status](https://travis-ci.org/minio/highwayhash.svg?branch=master)](https://travis-ci.org/minio/highwayhash)\n\n## HighwayHash\n\n[HighwayHash](https://github.com/google/highwayhash) is a pseudo-random-function (PRF) developed by Jyrki Alakuijala, Bill Cox and Jan Wassenberg (Google research). HighwayHash takes a 256 bit key and computes 64, 128 or 256 bit hash values of given messages.\n\nIt can be used to prevent hash-flooding attacks or authenticate short-lived messages. Additionally it can be used as a fingerprinting function. HighwayHash is not a general purpose cryptographic hash function (such as Blake2b, SHA-3 or SHA-2) and should not be used if strong collision resistance is required. \n\nThis repository contains a native Go version and optimized assembly implementations for Intel, ARM and ppc64le architectures.\n\n### High performance\n\nHighwayHash is an approximately 5x faster SIMD hash function as compared to [SipHash](https://www.131002.net/siphash/siphash.pdf) which in itself is a fast and 'cryptographically strong' pseudo-random function designed by Aumasson and Bernstein.\n\nHighwayHash uses a new way of mixing inputs with AVX2 multiply and permute instructions. The multiplications are 32x32 bit giving 64 bits-wide results and are therefore infeasible to reverse. Additionally permuting equalizes the distribution of the resulting bytes. The algorithm outputs digests ranging from 64 bits up to 256 bits at no extra cost.\n\n### Stable\n\nAll three output sizes of HighwayHash have been declared [stable](https://github.com/google/highwayhash/#versioning-and-stability) as of January 2018. This means that the hash results for any given input message are guaranteed not to change.\n\n### Installation\n\nInstall: `go get -u github.com/minio/highwayhash`\n\n### Intel Performance\n\nBelow are the single core results on an Intel Core i7 (3.1 GHz) for 256 bit outputs:\n\n```\nBenchmarkSum256_16      \t\t  204.17 MB/s\nBenchmarkSum256_64      \t\t 1040.63 MB/s\nBenchmarkSum256_1K      \t\t 8653.30 MB/s\nBenchmarkSum256_8K      \t\t13476.07 MB/s\nBenchmarkSum256_1M      \t\t14928.71 MB/s\nBenchmarkSum256_5M      \t\t14180.04 MB/s\nBenchmarkSum256_10M     \t\t12458.65 MB/s\nBenchmarkSum256_25M     \t\t11927.25 MB/s\n```\n\nSo for moderately sized messages it tops out at about 15 GB/sec. Also for small messages (1K) the performance is already at approximately 60% of the maximum throughput. \n\n### ARM Performance\n\nBelow are the single core results on an EC2 c7g.4xlarge (Graviton3) instance for 256 bit outputs:\n\n```\nBenchmarkSum256_16                143.66 MB/s\nBenchmarkSum256_64                628.75 MB/s\nBenchmarkSum256_1K               3621.71 MB/s\nBenchmarkSum256_8K               5039.64 MB/s\nBenchmarkSum256_1M               5279.79 MB/s\nBenchmarkSum256_5M               5474.60 MB/s\nBenchmarkSum256_10M              5621.73 MB/s\nBenchmarkSum256_25M              5250.47 MB/s\n```\n\n### ppc64le Performance\n\nThe ppc64le accelerated version is roughly 10x faster compared to the non-optimized version:\n\n```\nbenchmark              old MB/s     new MB/s     speedup\nBenchmarkWrite_8K      531.19       5566.41      10.48x\nBenchmarkSum64_8K      518.86       4971.88      9.58x\nBenchmarkSum256_8K     502.45       4474.20      8.90x\n```\n\n### Performance compared to other hashing techniques\n\nOn a Skylake CPU (3.0 GHz Xeon Platinum 8124M) the table below shows how HighwayHash compares to other hashing techniques for 5 MB messages (single core performance, all Golang implementations, see [benchmark](https://github.com/fwessels/HashCompare/blob/master/benchmarks_test.go)).\n\n```\nBenchmarkHighwayHash      \t    \t11986.98 MB/s\nBenchmarkSHA256_AVX512    \t    \t 3552.74 MB/s\nBenchmarkBlake2b          \t    \t  972.38 MB/s\nBenchmarkSHA1             \t    \t  950.64 MB/s\nBenchmarkMD5              \t    \t  684.18 MB/s\nBenchmarkSHA512           \t    \t  562.04 MB/s\nBenchmarkSHA256           \t    \t  383.07 MB/s\n```\n\n*Note: the AVX512 version of SHA256 uses the [multi-buffer crypto library](https://github.com/intel/intel-ipsec-mb) technique as developed by Intel, more details can be found in [sha256-simd](https://github.com/minio/sha256-simd/).*\n\n### Qualitative assessment\n\nWe have performed a 'qualitative' assessment of how HighwayHash compares to Blake2b in terms of the distribution of the checksums for varying numbers of messages. It shows that HighwayHash behaves similarly according to the following graph:\n\n![Hash Comparison Overview](https://s3.amazonaws.com/s3git-assets/hash-comparison-final.png)\n\nMore information can be found in [HashCompare](https://github.com/fwessels/HashCompare).\n\n### Requirements\n\nAll Go versions \u003e= 1.11 are supported (needed for required assembly support for the different platforms).\n\n### Contributing\n\nContributions are welcome, please send PRs for any enhancements.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminio%2Fhighwayhash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminio%2Fhighwayhash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminio%2Fhighwayhash/lists"}