• Eric Biggers's avatar
    fscrypt: invoke crypto API for ESSIV handling · 4006d799
    Eric Biggers authored
    Instead of open-coding the calculations for ESSIV handling, use an ESSIV
    skcipher which does all of this under the hood.  ESSIV was added to the
    crypto API in v5.4.
    
    This is based on a patch from Ard Biesheuvel, but reworked to apply
    after all the fscrypt changes that went into v5.4.
    
    Tested with 'kvm-xfstests -c ext4,f2fs -g encrypt', including the
    ciphertext verification tests for v1 and v2 encryption policies.
    
    Originally-from: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    4006d799
keysetup_v1.c 9.73 KB