Re: [patch] UBIFS: Add cryptographic functionality when a key ispassed to the compress / decompress functions

From: Joel Reardon
Date: Mon Apr 02 2012 - 10:48:43 EST



>
> You support only one length - please, kill ivlen parameter.
>
> Also, should ubifs_aes_crypt be static? I do not see any users outside
> of compress.c. In this case remove the "ubifs_" prefix. But a
> non-written convention, in UBIFS we _tend_ to prefix only non-static
> functions with "ubifs_" and avoid having it for static functions.
>

Should length for key remain, and the IV is just the same? Or should the
global #define just be used inside the aes function.

There is another use where the data is decrypted and reencrypted with a
different key. (during GC and if an erase block becomes bad.) In this
case, the data is not decompressed and recompressed, only the encryption
changes. However, for simplicity, and because its not frequent, we can
make it static and use the compress functions to handle this.

>
> I guess the above goto is redundant?
>

It is, but I put it in for future developers who may add a new control
case there after without expecting the above to 'fall through'.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/