On Wed, 14 May 2008, Herbert Xu wrote: > On Tue, May 13, 2008 at 04:35:03PM -0400, Mikulas Patocka wrote: >> >> And where would you propose to place this bit? >> >> One possibility would be struct crypto_tfm->crt_flags >> Another possibility is struct crypto_alg->cra_flags > > The latter definitely because this is an algorithm property. > >> Can chaining mode change the value of the flag? (I presume that yes) > > If you mean templates like CBC then it depends. You should > set it to zero by default for safety but most of them should > be able to turn it on once audited. > > If it turns out that the majority of algorithms support this, > you could even decide to only select those algorithms that do. > Suppose your bit is > > CRYPTO_ALG_FOO > > then you could do > > crypto_alloc_blkcipher(name, CRYPTO_ALG_FOO, CRYPTO_ALG_FOO) > > to demand only those algorithms that comply. > > Cheers, Hi Here I send the patches, the first one copied data in dm-crypt unconditionally. The second one adds a flag to coplying algorithms. The third one skips the copy for complying algorithms. The fourth one is removing useless increment in arc4 that I found while reviewing the ciphers. All the ciphers comply, so the bug is only a theroretical issue (but I didn't check assembler versions --- they should be checked by the person who wrote them, assembler is write-only language). Please review my changes to crypto code, I am not crypto developer and I do not understand it as well as people maintaining it. Mikulas