[patch] UBIFS: Add cryptographic functionality when a key is passed to the compress / decompress functions
Joel Reardon
joel at clambassador.com
Mon Apr 2 10:48:42 EDT 2012
>
> 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'.
More information about the linux-mtd
mailing list