diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2024-02-25 14:32:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 13:32:13 +0000 |
commit | f79c9e817abaef279c0b33d5460a066170dd3ea6 (patch) | |
tree | bc0ca11ec487aab8458fe78e89a6d21d50baa53b /services | |
parent | ad0a34b492c3d41952ff4648c8bfb7b54c376151 (diff) | |
download | gitea-f79c9e817abaef279c0b33d5460a066170dd3ea6.tar.gz gitea-f79c9e817abaef279c0b33d5460a066170dd3ea6.zip |
Use `crypto/sha256` (#29386)
Go 1.21 improved the performance of `crypto/sha256`. It's now similar to
`minio/sha256-simd`, so we should just use the standard libs.
https://go.dev/doc/go1.21#crypto/sha256
https://go-review.googlesource.com/c/go/+/408795
https://github.com/multiformats/go-multihash/pull/173
Diffstat (limited to 'services')
-rw-r--r-- | services/lfs/server.go | 2 | ||||
-rw-r--r-- | services/mailer/token/token.go | 3 | ||||
-rw-r--r-- | services/webhook/deliver.go | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/services/lfs/server.go b/services/lfs/server.go index 62134b7d60..56714120ad 100644 --- a/services/lfs/server.go +++ b/services/lfs/server.go @@ -5,6 +5,7 @@ package lfs import ( stdCtx "context" + "crypto/sha256" "encoding/base64" "encoding/hex" "errors" @@ -33,7 +34,6 @@ import ( "code.gitea.io/gitea/modules/storage" "github.com/golang-jwt/jwt/v5" - "github.com/minio/sha256-simd" ) // requestContext contain variables from the HTTP request. diff --git a/services/mailer/token/token.go b/services/mailer/token/token.go index aa7b567188..8a5a762d6b 100644 --- a/services/mailer/token/token.go +++ b/services/mailer/token/token.go @@ -6,14 +6,13 @@ package token import ( "context" crypto_hmac "crypto/hmac" + "crypto/sha256" "encoding/base32" "fmt" "time" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/util" - - "github.com/minio/sha256-simd" ) // A token is a verifiable container describing an action. diff --git a/services/webhook/deliver.go b/services/webhook/deliver.go index 8f728d3aa6..935981d29c 100644 --- a/services/webhook/deliver.go +++ b/services/webhook/deliver.go @@ -7,6 +7,7 @@ import ( "context" "crypto/hmac" "crypto/sha1" + "crypto/sha256" "crypto/tls" "encoding/hex" "fmt" @@ -29,7 +30,6 @@ import ( webhook_module "code.gitea.io/gitea/modules/webhook" "github.com/gobwas/glob" - "github.com/minio/sha256-simd" ) // Deliver deliver hook task |