On Mon, Dec 28, 2009 at 08:37:43PM +0100, Milan Broz wrote: > On 12/28/2009 07:59 PM, Max Vozeler wrote: > > The original code used cc->cipher for two things: > > > @@ -1014,6 +1014,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) > > char *ivopts; > > unsigned int key_size; > > unsigned long long tmpll; > > + char ciphermode[CRYPTO_MAX_ALG_NAME]; > > Today is CRYPTO_MAX_ALG_NAME 64 bytes but it can increase in future. > This should not be allocated on the stack. OK. The mode string is only ever used within crypt_ctr(). It does not seem worth to move it into struct crypt_config or have it dynamically allocated, so I'll drop this cleanup. > But anyway, I see that the reason for this is to introduce multikey feature > (compatible with loop-AES mode). That's interesting idea. > > But please can you add more explanation into documentation about this mode? Sure, let me see what I can do. The most detailed description I know of is [1]. Besides the description in the Loop-AES documentation there are also some notes I took while doing the reimplementation. I'll see if I can put all these bits together into a document to have one mode and format specification. > Is there any paper which analyses that mode - if so can you add link > to description? > (and yes, I know loop-AES documentation:-) I'm not aware of any papers which analyze these modes. The 2004 paper by Saarinen[2] I think is what prompted the creation of these modes, specifically do protect against the weaknesses pointed out therein. The resulting v2 and v3 modes have not been independently analyzed as far as I'm aware. Anyone know better? Thanks for your comments, Max -- [1] http://mail.nl.linux.org/linux-crypto/2006-01/msg00006.html [2] http://mareichelt.de/pub/notmine/diskenc.pdf - Linux-crypto: cryptography in and on the Linux system Archive: http://mail.nl.linux.org/linux-crypto/