From e663a3ee2287be77dcd44631b29147a1eddcb4f0 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 9 Sep 2023 11:30:45 -0700 Subject: Re-run 'make format' with latest version of gofmt --- crypto/crypto.go | 22 +++++++++++----------- crypto/crypto_test.go | 4 +++- crypto/rand.go | 3 ++- 3 files changed, 16 insertions(+), 13 deletions(-) (limited to 'crypto') 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 -m -p

-l 32 +// +// echo "password" | argon2 "aaaaaaaaaaaaaaaa" -id -t -m -p

-l 32 +// // where costs.Time = , costs.Memory = 2^, and costs.Parallelism =

. 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 -- cgit v1.2.3