Re: [CRYPTO] is it really optimized ?

From: Helge Hafting
Date: Fri Apr 13 2007 - 08:25:05 EST


Francis Moreau wrote:
Hi,

After reading the crypto code and trying to implement a AES driver,
I'm wondering if the current implementation is optimum. My plan is to
use _exclusively_ the AES driver to encrypt filesystems by using
eCryptfs for example.

But it seems that because the current implementation of the crypto
core allows the drivers to be accessed by any part of the kernel at
any time, that forces the AES driver to do extra works for each block
ciphering: mainly they are (a) set the key in AES controller (b)
generate the decryption key if in decrypt mode.

So is this interpretation right ? If so wouldn't it be appropriate to
introduce a mechanism to reserve this AES hardware for a special
purpose (filesystem encryptions) and thus make it as fast as possible
?

Would this really help?
When reading/writing files, most of the time is i/o-wait, isn't it?

Reserving the device exclusively seems excessive. How about
a quick test to see if someone else have been using it since
the last time your crypto-fs used it? If nobody else used it, then
you don't need to reset they key and so on.

If nobody else is using the AES controller, you get the same speed
as with a reservation. If something else is using AES then it won't be
as fast, but then the AES controller have been used for other useful
work as well. Other parts of the kernel surely won't use it just for fun. :-)

Helge Hafting


-
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/