fscrypt: split up FS_CRYPTO_BLOCK_SIZE
authorEric Biggers <ebiggers@google.com>
Tue, 5 Apr 2022 01:09:14 +0000 (18:09 -0700)
committerEric Biggers <ebiggers@google.com>
Wed, 13 Apr 2022 22:03:09 +0000 (15:03 -0700)
commit63cec1389e116ae0e2a15e612a5b49651e04be3f
treec1d31f842262e5de906e5845f3c2bb15736a25ad
parentce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e
fscrypt: split up FS_CRYPTO_BLOCK_SIZE

FS_CRYPTO_BLOCK_SIZE is neither the filesystem block size nor the
granularity of encryption.  Rather, it defines two logically separate
constraints that both arise from the block size of the AES cipher:

- The alignment required for the lengths of file contents blocks
- The minimum input/output length for the filenames encryption modes

Since there are way too many things called the "block size", and the
connection with the AES block size is not easily understood, split
FS_CRYPTO_BLOCK_SIZE into two constants FSCRYPT_CONTENTS_ALIGNMENT and
FSCRYPT_FNAME_MIN_MSG_LEN that more clearly describe what they are.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20220405010914.18519-1-ebiggers@kernel.org
fs/crypto/crypto.c
fs/crypto/fname.c
fs/ubifs/ubifs.h
include/linux/fscrypt.h