aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/crypto/argon2
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/crypto/argon2')
-rw-r--r--vendor/golang.org/x/crypto/argon2/argon2.go14
-rw-r--r--vendor/golang.org/x/crypto/argon2/blamka_amd64.go7
-rw-r--r--vendor/golang.org/x/crypto/argon2/blamka_amd64.s9
3 files changed, 11 insertions, 19 deletions
diff --git a/vendor/golang.org/x/crypto/argon2/argon2.go b/vendor/golang.org/x/crypto/argon2/argon2.go
index 798f5cb..b423fea 100644
--- a/vendor/golang.org/x/crypto/argon2/argon2.go
+++ b/vendor/golang.org/x/crypto/argon2/argon2.go
@@ -54,11 +54,12 @@ const (
// Key derives a key from the password, salt, and cost parameters using Argon2i
// returning a byte slice of length keyLen that can be used as cryptographic
-// key. The CPU cost and parallism degree must be greater than zero.
+// key. The CPU cost and parallelism degree must be greater than zero.
//
// For example, you can get a derived key for e.g. AES-256 (which needs a
-// 32-byte key) by doing: `key := argon2.Key([]byte("some password"), salt, 3,
-// 32*1024, 4, 32)`
+// 32-byte key) by doing:
+//
+// key := argon2.Key([]byte("some password"), salt, 3, 32*1024, 4, 32)
//
// The draft RFC recommends[2] time=3, and memory=32*1024 is a sensible number.
// If using that amount of memory (32 MB) is not possible in some contexts then
@@ -76,12 +77,13 @@ func Key(password, salt []byte, time, memory uint32, threads uint8, keyLen uint3
// IDKey derives a key from the password, salt, and cost parameters using
// Argon2id returning a byte slice of length keyLen that can be used as
-// cryptographic key. The CPU cost and parallism degree must be greater than
+// cryptographic key. The CPU cost and parallelism degree must be greater than
// zero.
//
// For example, you can get a derived key for e.g. AES-256 (which needs a
-// 32-byte key) by doing: `key := argon2.IDKey([]byte("some password"), salt, 1,
-// 64*1024, 4, 32)`
+// 32-byte key) by doing:
+//
+// key := argon2.IDKey([]byte("some password"), salt, 1, 64*1024, 4, 32)
//
// The draft RFC recommends[2] time=1, and memory=64*1024 is a sensible number.
// If using that amount of memory (64 MB) is not possible in some contexts then
diff --git a/vendor/golang.org/x/crypto/argon2/blamka_amd64.go b/vendor/golang.org/x/crypto/argon2/blamka_amd64.go
index bb2b0d8..2fc1ec0 100644
--- a/vendor/golang.org/x/crypto/argon2/blamka_amd64.go
+++ b/vendor/golang.org/x/crypto/argon2/blamka_amd64.go
@@ -6,14 +6,13 @@
package argon2
+import "golang.org/x/sys/cpu"
+
func init() {
- useSSE4 = supportsSSE4()
+ useSSE4 = cpu.X86.HasSSE41
}
//go:noescape
-func supportsSSE4() bool
-
-//go:noescape
func mixBlocksSSE2(out, a, b, c *block)
//go:noescape
diff --git a/vendor/golang.org/x/crypto/argon2/blamka_amd64.s b/vendor/golang.org/x/crypto/argon2/blamka_amd64.s
index 8a83f7c..74a6e73 100644
--- a/vendor/golang.org/x/crypto/argon2/blamka_amd64.s
+++ b/vendor/golang.org/x/crypto/argon2/blamka_amd64.s
@@ -241,12 +241,3 @@ loop:
SUBQ $2, BP
JA loop
RET
-
-// func supportsSSE4() bool
-TEXT ·supportsSSE4(SB), 4, $0-1
- MOVL $1, AX
- CPUID
- SHRL $19, CX // Bit 19 indicates SSE4 support
- ANDL $1, CX // CX != 0 if support SSE4
- MOVB CX, ret+0(FP)
- RET