Ard Biesheuvel 39d13a1ac4 dm crypt: reuse eboiv skcipher for IV generation
Instead of instantiating a separate cipher to perform the encryption
needed to produce the IV, reuse the skcipher used for the block data
and invoke it one additional time for each block to encrypt a zero
vector and use the output as the IV.

For CBC mode, this is equivalent to using the bare block cipher, but
without the risk of ending up with a non-time invariant implementation
of AES when the skcipher itself is time variant (e.g., arm64 without
Crypto Extensions has a NEON based time invariant implementation of
cbc(aes) but no time invariant implementation of the core cipher other
than aes-ti, which is not enabled by default).

This approach is a compromise between dm-crypt API flexibility and
reducing dependence on parts of the crypto API that should not usually
be exposed to other subsystems, such as the bare cipher API.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2019-08-23 10:13:13 -04:00
..
2019-08-10 12:20:02 -07:00
2019-07-19 17:13:56 -07:00
2019-07-18 09:49:30 +02:00
2019-07-17 09:55:43 -07:00
2019-08-07 14:50:49 -07:00
2019-07-29 11:34:12 -07:00
2019-08-01 20:21:00 +02:00
2019-07-09 08:59:39 -07:00
2019-07-20 09:34:55 -07:00
2019-07-11 18:11:21 -07:00
2019-07-11 15:14:01 -07:00
2019-08-10 12:24:20 -07:00
2019-08-04 16:37:08 -07:00
2019-07-27 08:25:51 -07:00
2019-07-15 20:44:49 -07:00
2019-07-01 15:04:59 +02:00
2019-07-17 11:44:41 -07:00
2019-07-19 17:13:56 -07:00
2019-07-17 10:03:50 -07:00
2019-07-05 08:15:08 +02:00
2019-08-05 11:49:02 -07:00
2019-07-17 11:23:13 -07:00
2019-08-02 15:26:48 -07:00