diff options
author | zeripath <art27@cantab.net> | 2023-02-22 19:21:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-22 14:21:46 -0500 |
commit | 1319ba6742a8562453646763adad22379674bab5 (patch) | |
tree | fe62dccd8bc7d8fb33f882257a53a2ce4eab1ccf /modules/lfs | |
parent | eb5a55785de39ae7162911f553b132c03ae7b424 (diff) | |
download | gitea-1319ba6742a8562453646763adad22379674bab5.tar.gz gitea-1319ba6742a8562453646763adad22379674bab5.zip |
Use minio/sha256-simd for accelerated SHA256 (#23052)
minio/sha256-simd provides additional acceleration for SHA256 using
AVX512, SHA Extensions for x86 and ARM64 for ARM.
It provides a drop-in replacement for crypto/sha256 and if the
extensions are not available it falls back to standard crypto/sha256.
---------
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Diffstat (limited to 'modules/lfs')
-rw-r--r-- | modules/lfs/content_store.go | 3 | ||||
-rw-r--r-- | modules/lfs/pointer.go | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/lfs/content_store.go b/modules/lfs/content_store.go index 94277a6b8e..a4ae21bfd6 100644 --- a/modules/lfs/content_store.go +++ b/modules/lfs/content_store.go @@ -4,7 +4,6 @@ package lfs import ( - "crypto/sha256" "encoding/hex" "errors" "hash" @@ -13,6 +12,8 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/storage" + + "github.com/minio/sha256-simd" ) var ( diff --git a/modules/lfs/pointer.go b/modules/lfs/pointer.go index b5e13d56a3..f7f225bf1c 100644 --- a/modules/lfs/pointer.go +++ b/modules/lfs/pointer.go @@ -4,7 +4,6 @@ package lfs import ( - "crypto/sha256" "encoding/hex" "errors" "fmt" @@ -15,6 +14,8 @@ import ( "strings" "code.gitea.io/gitea/modules/log" + + "github.com/minio/sha256-simd" ) const ( |