From 1319ba6742a8562453646763adad22379674bab5 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 22 Feb 2023 19:21:46 +0000 Subject: 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 Co-authored-by: John Olheiser --- modules/lfs/content_store.go | 3 ++- modules/lfs/pointer.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'modules/lfs') 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 ( -- cgit v1.2.3