You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,18 @@
1
1
# sha256-simd
2
2
3
-
Accelerate SHA256 computations in pure Go using AVX512, SHA Extensions and AVX2 for Intel and ARM64 for ARM. On AVX512 it provides an up to 8x improvement (over 3 GB/s per core) in comparison to AVX2. SHA Extensions give a performance boost of close to 4x over AVX2.
3
+
Accelerate SHA256 computations in pure Go using AVX512, SHA Extensions for x86 and ARM64 for ARM.
4
+
On AVX512 it provides an up to 8x improvement (over 3 GB/s per core).
5
+
SHA Extensions give a performance boost of close to 4x over native.
4
6
5
7
## Introduction
6
8
7
-
This package is designed as a replacement for `crypto/sha256`. For Intel CPUs it has two flavors for AVX512 and AVX2 (AVX/SSE are also supported). For ARM CPUs with the Cryptography Extensions, advantage is taken of the SHA2 instructions resulting in a massive performance improvement.
9
+
This package is designed as a replacement for `crypto/sha256`.
10
+
For ARM CPUs with the Cryptography Extensions, advantage is taken of the SHA2 instructions resulting in a massive performance improvement.
8
11
9
-
This package uses Golang assembly. The AVX512 version is based on the Intel's "multi-buffer crypto library for IPSec" whereas the other Intel implementations are described in "Fast SHA-256 Implementations on Intel Architecture Processors" by J. Guilford et al.
12
+
This package uses Golang assembly.
13
+
The AVX512 version is based on the Intel's "multi-buffer crypto library for IPSec" whereas the other Intel implementations are described in "Fast SHA-256 Implementations on Intel Architecture Processors" by J. Guilford et al.
10
14
11
-
## New: Support for Intel SHA Extensions
15
+
## Support for Intel SHA Extensions
12
16
13
17
Support for the Intel SHA Extensions has been added by Kristofer Peterson (@svenski123), originally developed for spacemeshos [here](https://github.com/spacemeshos/POET/issues/23). On CPUs that support it (known thus far Intel Celeron J3455 and AMD Ryzen) it gives a significant boost in performance (with thanks to @AudriusButkevicius for reporting the results; full results [here](https://github.com/minio/sha256-simd/pull/37#issuecomment-451607827)).
Thanks to Kristofer Peterson, we also added additional performance changes such as optimized padding, endian conversions which sped up all implementations i.e. Intel SHA alone while doubled performance for small sizes, the other changes increased everything roughly 50%.
25
+
Thanks to Kristofer Peterson, we also added additional performance changes such as optimized padding,
26
+
endian conversions which sped up all implementations i.e. Intel SHA alone while doubled performance for small sizes,
27
+
the other changes increased everything roughly 50%.
22
28
23
29
## Support for AVX512
24
30
@@ -58,7 +64,8 @@ More detailed information can be found in this [blog](https://blog.minio.io/acce
58
64
59
65
## Drop-In Replacement
60
66
61
-
The following code snippet shows how you can use `github.com/minio/sha256-simd`. This will automatically select the fastest method for the architecture on which it will be executed.
67
+
The following code snippet shows how you can use `github.com/minio/sha256-simd`.
68
+
This will automatically select the fastest method for the architecture on which it will be executed.
62
69
63
70
```go
64
71
import"github.com/minio/sha256-simd"
@@ -80,9 +87,6 @@ Below is the speed in MB/s for a single core (ranked fast to slow) for blocks la
0 commit comments