Hi Herbert, Noriaki, On Monday 19 November 2007 10:49, Noriaki TAKAMIYA wrote: > > > > 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? > > Sorry for late reply. > > I think you're testing now:-), and if speed impact is less than 1% > as you say, I think it is acceptable. Actaually I tested it only now. Explored wonders of ubuntu package management. Why it doesn't rebuild module when I do "touch camellia.c" and then run their magic stuff? I suspected that these .deb, .rpm, .whatever are evil, but it changed today. Now I *know* that. ;) Back to patches. It turns out that two more key setup stages can be easily folded into common "tail". Attached patches do this. I'm also attaching all previous patches not yet ACKed by Herbert (patches 5,6,7). camellia8: Analogously to camellia7 patch, move "absorb kw2 to other subkeys" and "absorb kw4 to other subkeys" code parts into camellia_setup_tail(). This further reduces source and object code size at the cost of two brances in key setup code. Code sizes (starting from the state with pathces 1-4 already applied): 64-bit: dec hex filename 22786 5902 2.6.23.1.camellia4.t64/crypto/camellia.o 21422 53ae 2.6.23.1.camellia5.t64/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 15670 3d36 2.6.23.1.camellia8.t64/crypto/camellia.o 32-bit: 29948 74fc 2.6.23.1.camellia4.t/crypto/camellia.o 29457 7311 2.6.23.1.camellia5.t/crypto/camellia.o 21414 53a6 2.6.23.1.camellia6.t/crypto/camellia.o 20518 5026 2.6.23.1.camellia7.t/crypto/camellia.o 18454 4816 2.6.23.1.camellia8.t/crypto/camellia.o Code is compile-tested for 32/64-bit x86 and run tested on 32-bit (tcrypt tests all pass). Herbert, please let me know what you think about them. Signed-off-by: Denys Vlasenko -- vda