Hi Herbert, On Sunday 18 November 2007 05:21, Herbert Xu wrote: > On Wed, Nov 14, 2007 at 02:28:25PM -0700, Denys Vlasenko wrote: > > I also split this patch into two parts for easier review: > > camellia5: > > adds 64-bit key setup > > Sorry but this still duplicates way too much code. Also key > setup is the slow path relatively speaking so it's even less > justifiable. Oh, Herbert, have heart, my camellia.c source file is smaller than the one I started from. It's not like it's twice as big. It's smaller already. 64-bit key setup is not just faster, it is also smaller by ~4k, and this benefit is always there, not only when key setup is performed. With attached camellia7 patch, I further reduce the size of key setup routines by reusing a bit of the code at the end of them. 2 screenfuls of code less. I hope it makes code duplication a bit more tolerable. > > camellia6: > > unifies encrypt/decrypt routines for different key lengths. > > This reduces module size by ~25%, with tiny (less than 1%) > > speed impact. > > Also collapses encrypt/decrypt into more readable > > (visually shorter) form using macros. And here is camellia7: Move "key XOR is end of F-function" code part into camellia_setup_tail(), it is sufficiently similar between camellia_setup128 and camellia_setup256. This shaves off another ~1k: dec hex filename 21414 53a6 2.6.23.1.camellia6.t/crypto/camellia.o 20518 5026 2.6.23.1.camellia7.t/crypto/camellia.o 16355 3fe3 2.6.23.1.camellia6.t64/crypto/camellia.o 15813 3dc5 2.6.23.1.camellia7.t64/crypto/camellia.o At the moment I cannot run test it, try to do it ASAP. Takamiya-san, can you review attached patch please? Signed-off-by: Denys Vlasenko -- vda