aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2023-09-09 11:30:45 -0700
committerEric Biggers <ebiggers@google.com>2023-09-09 11:30:45 -0700
commite663a3ee2287be77dcd44631b29147a1eddcb4f0 (patch)
tree07f2f6d6cd79d6f892c11d7ab808ae0372d4444d /crypto
parentc999f0b04c526a85d061a7461c0e4211e94f9fb7 (diff)
Re-run 'make format' with latest version of gofmt
Diffstat (limited to 'crypto')
-rw-r--r--crypto/crypto.go22
-rw-r--r--crypto/crypto_test.go4
-rw-r--r--crypto/rand.go3
3 files changed, 16 insertions, 13 deletions
diff --git a/crypto/crypto.go b/crypto/crypto.go
index edc4ed7..6a719dd 100644
--- a/crypto/crypto.go
+++ b/crypto/crypto.go
@@ -18,17 +18,17 @@
*/
// Package crypto manages all the cryptography for fscrypt. This includes:
-// 1. Key management (key.go)
-// - Securely holding keys in memory
-// - Making recovery keys
-// 2. Randomness (rand.go)
-// 3. Cryptographic algorithms (crypto.go)
-// - encryption (AES256-CTR)
-// - authentication (SHA256-based HMAC)
-// - key stretching (SHA256-based HKDF)
-// - key wrapping/unwrapping (Encrypt then MAC)
-// - passphrase-based key derivation (Argon2id)
-// - key descriptor computation (double SHA512, or HKDF-SHA512)
+// 1. Key management (key.go)
+// - Securely holding keys in memory
+// - Making recovery keys
+// 2. Randomness (rand.go)
+// 3. Cryptographic algorithms (crypto.go)
+// - encryption (AES256-CTR)
+// - authentication (SHA256-based HMAC)
+// - key stretching (SHA256-based HKDF)
+// - key wrapping/unwrapping (Encrypt then MAC)
+// - passphrase-based key derivation (Argon2id)
+// - key descriptor computation (double SHA512, or HKDF-SHA512)
package crypto
import (
diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go
index f98c643..1fa5a0c 100644
--- a/crypto/crypto_test.go
+++ b/crypto/crypto_test.go
@@ -64,7 +64,9 @@ func fakePassphraseKey() (*Key, error) {
// Values for test cases pulled from argon2 command line tool.
// To generate run:
-// echo "password" | argon2 "aaaaaaaaaaaaaaaa" -id -t <t> -m <m> -p <p> -l 32
+//
+// echo "password" | argon2 "aaaaaaaaaaaaaaaa" -id -t <t> -m <m> -p <p> -l 32
+//
// where costs.Time = <t>, costs.Memory = 2^<m>, and costs.Parallelism = <p>.
type hashTestCase struct {
costs *metadata.HashingCosts
diff --git a/crypto/rand.go b/crypto/rand.go
index 7d1e55b..527f841 100644
--- a/crypto/rand.go
+++ b/crypto/rand.go
@@ -30,7 +30,8 @@ import (
// the operating system has insufficient randomness, the buffer creation will
// fail. This is an improvement over Go's built-in crypto/rand which will still
// return bytes if the system has insufficiency entropy.
-// See: https://github.com/golang/go/issues/19274
+//
+// See: https://github.com/golang/go/issues/19274
//
// While this syscall was only introduced in Kernel v3.17, it predates the
// introduction of filesystem encryption, so it introduces no additional