aboutsummaryrefslogtreecommitdiffstats
path: root/models/auth/twofactor.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2024-02-25 14:32:13 +0100
committerGitHub <noreply@github.com>2024-02-25 13:32:13 +0000
commitf79c9e817abaef279c0b33d5460a066170dd3ea6 (patch)
treebc0ca11ec487aab8458fe78e89a6d21d50baa53b /models/auth/twofactor.go
parentad0a34b492c3d41952ff4648c8bfb7b54c376151 (diff)
downloadgitea-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 'models/auth/twofactor.go')
-rw-r--r--models/auth/twofactor.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/auth/twofactor.go b/models/auth/twofactor.go
index 51061e5205..d0c341a192 100644
--- a/models/auth/twofactor.go
+++ b/models/auth/twofactor.go
@@ -6,6 +6,7 @@ package auth
import (
"context"
"crypto/md5"
+ "crypto/sha256"
"crypto/subtle"
"encoding/base32"
"encoding/base64"
@@ -18,7 +19,6 @@ import (
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
- "github.com/minio/sha256-simd"
"github.com/pquerna/otp/totp"
"golang.org/x/crypto/pbkdf2"
)