FROMLIST: f2fs: Handle casefolding with Encryption

This expands f2fs's casefolding support to include encrypted
directories. For encrypted directories, we use the siphash of the
casefolded name. This ensures there is no direct way to go from an
unencrypted name to the stored hash on disk without knowledge of the
encryption policy keys.

Additionally, we switch to using the vfs layer's casefolding support
instead of storing this information inside of f2fs's private data.

Signed-off-by: Daniel Rosenberg <>
Note: Fixed some missing type conversions, crypto length issue
      and hash check for ciphertext name
Test: Boots, /data/media is case insensitive
Bug: 138322712
Change-Id: I8f1e324472668e27d3e059cc80e4c981ce89dd9b
5 files changed