https://github.com/bwesterb/go-sha256x8
Pure Go eight-way sha256 using AVX2
https://github.com/bwesterb/go-sha256x8
avx2 golang peachpy sha256 sha256x8
Last synced: 2 months ago
JSON representation
Pure Go eight-way sha256 using AVX2
- Host: GitHub
- URL: https://github.com/bwesterb/go-sha256x8
- Owner: bwesterb
- License: mit
- Created: 2018-06-10T11:09:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-24T18:05:53.000Z (over 7 years ago)
- Last Synced: 2024-06-20T10:12:15.212Z (about 2 years ago)
- Topics: avx2, golang, peachpy, sha256, sha256x8
- Language: Assembly
- Homepage: https://godoc.org/github.com/bwesterb/go-sha256x8
- Size: 32.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
sha256x8
========
This pure Go package implements an eight-way SHA256 using AVX2 instructions.
Basic usage
-----------
The following
```go
data := [8][]byte{
[]byte("Eight pieces of data"),
[]byte("which all must have "),
[]byte("the same length "),
[]byte(" "),
[]byte("Eight pieces of data"),
[]byte("which all must have "),
[]byte("the same length "),
[]byte(" "),
}
out := [8][32]byte{}
sha256x8.SumsInto(data,
[8][]byte{
out[0][:], out[1][:], out[2][:], out[3][:],
out[4][:], out[5][:], out[6][:], out[7][:],
})
fmt.Printf("%x\n", out)
```
will output
```
[38ce9135c02f5ee3cfc527e9d33d6cc7c5f387ee0f272af21d73b14c79c8bad4 c0aa3c27409dcebf899fb5eac8fd5ea098c22b3e2400b79f1a1128df83954aa9 928c112e5a5d9eac1d6100d603942ec4a8b1002b04449cc05fb3388bb4dde9b6 1e8a105dbcab2f5d6b30a670c0ff91942f4db62401e669331037101e94198250 38ce9135c02f5ee3cfc527e9d33d6cc7c5f387ee0f272af21d73b14c79c8bad4 c0aa3c27409dcebf899fb5eac8fd5ea098c22b3e2400b79f1a1128df83954aa9 928c112e5a5d9eac1d6100d603942ec4a8b1002b04449cc05fb3388bb4dde9b6 1e8a105dbcab2f5d6b30a670c0ff91942f4db62401e669331037101e94198250]
```
[See godoc for more documentation](https://godoc.org/github.com/bwesterb/go-sha256x8).
Acknowledgement
---------------
This package is based on the [SPHINCS+ AVX2 sha256x8 code](
https://github.com/sphincs/sphincsplus) and Bernstein's `crypto_hash_sha256`.
Contributing
------------
There is still quite a lot to do:
- Optimize buffering
- SHA256NI backend
- AVX512 backend
- AVX backend
- ARM SIMD backend