[7/*] [CRYPTO] Kill obsolete iv check in cbc_process()

From: Herbert Xu
Date: Tue Mar 22 2005 - 06:25:02 EST


Hi:

Here's some more optimisations plus a bug fix for a pathological case
where in_place might not be set correctly which can't happen with any
of the current users. Here is the first one:

We have long since stopped using a null cit_iv as a means of doing null
encryption. In fact it doesn't work here anyway since we need to copy
src into dst to achieve null encryption.

No user of cbc_encrypt_iv/cbc_decrypt_iv does this either so let's just
get rid of this check which is sitting in the fast path.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
===== cipher.c 1.24 vs edited =====
--- 1.24/crypto/cipher.c 2005-03-21 18:41:41 +11:00
+++ edited/cipher.c 2005-03-22 21:28:00 +11:00
@@ -145,11 +145,7 @@
cryptfn_t fn, int enc, void *info)
{
u8 *iv = info;
-
- /* Null encryption */
- if (!iv)
- return;
-
+
if (enc) {
tfm->crt_u.cipher.cit_xor_block(iv, src);
fn(crypto_tfm_ctx(tfm), dst, iv);