blake3

BLAKE3 加密哈希函数的纯 Go 实现。「A pure Go implementation of the BLAKE3 cryptographic hash function」

  • 所有者: lukechampine/blake3
  • 平台: Windows,Linux,Mac
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

blake3

GoDoc
Go Report Card

go get lukechampine.com/blake3

blake3 implements the BLAKE3 cryptographic hash function.
This implementation aims to be performant without sacrificing (too much)
readability, in the hopes of eventually landing in x/crypto.

In addition to the pure-Go implementation, this package also contains AVX-512
and AVX2 routines (generated by avo)
that greatly increase performance for large inputs and outputs.

Contributions are greatly appreciated.
All contributors are eligible to receive an Urbit planet.

Benchmarks

Tested on a 2020 MacBook Air (i5-7600K @ 3.80GHz). Benchmarks will improve as
soon as I get access to a beefier AVX-512 machine. :wink:

AVX-512

BenchmarkSum256/64           120 ns/op       533.00 MB/s
BenchmarkSum256/1024        2229 ns/op       459.36 MB/s
BenchmarkSum256/65536      16245 ns/op      4034.11 MB/s
BenchmarkWrite               245 ns/op      4177.38 MB/s
BenchmarkXOF                 246 ns/op      4159.30 MB/s

AVX2

BenchmarkSum256/64           120 ns/op       533.00 MB/s
BenchmarkSum256/1024        2229 ns/op       459.36 MB/s
BenchmarkSum256/65536      31137 ns/op      2104.76 MB/s
BenchmarkWrite               487 ns/op      2103.12 MB/s
BenchmarkXOF                 329 ns/op      3111.27 MB/s

Pure Go

BenchmarkSum256/64           120 ns/op       533.00 MB/s
BenchmarkSum256/1024        2229 ns/op       459.36 MB/s
BenchmarkSum256/65536     133505 ns/op       490.89 MB/s
BenchmarkWrite              2022 ns/op       506.36 MB/s
BenchmarkXOF                1914 ns/op       534.98 MB/s

Shortcomings

There is no assembly routine for single-block compressions. This is most
noticeable for ~1KB inputs.

Each assembly routine inlines all 7 rounds, causing thousands of lines of
duplicated code. Ideally the routines could be merged such that only a single
routine is generated for AVX-512 and AVX2, without sacrificing too much
performance.

主要指標

概覽
名稱與所有者lukechampine/blake3
主編程語言Assembly
編程語言Go (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2020-01-09 20:10:45
推送於2025-05-08 12:37:59
最后一次提交2025-05-08 13:37:30
發布數18
最新版本名稱v1.4.1 (發布於 )
第一版名稱v0.1.0 (發布於 )
用户参与
星數388
關注者數11
派生數26
提交數62
已啟用問題?
問題數15
打開的問題數6
拉請求數4
打開的拉請求數0
關閉的拉請求數7
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?