On Tue, Oct 02, 2007 at 09:05:12PM +0200, Sebastian Siewior (linux-crypto@xxxxxxxxxxxxxxxx) wrote: > >DES currently does not pass tcrypt's multipage test, since HIFN adapter > >can not work with non-blocksize aligned chunks, although crypto alignmask > >is set to 3, tcrypt provides a block of size 2 in its multipage test, > >which fails. > I recalled now that I forgot to point this out. You set the align mask to > the block size of the algorithm but it is almost unused / useless. > Let me explain: > - it is ensured that the key you get (in the setkey function) is > properly aligned. This doesn't matter in your case because you > memcpy() the key away to your private struct. > - your private struct is pointer aligned (if I remember correctly). You > memcpy() your key away so it looks like you don't need the ctx > aligned according to your mask (but it would be possible :)) > - the proper alignment of src, dst and the IV that you get is _not_ > ensured. This would be the case if you would develop a blkcipher and > use blkcipher_walk_init(), blkcipher_walk_virt(), .... > > Now. If you pass your AES-tcrypt-test (where you need 16 bytes alignment) > than this is pure luck. If you really need aligned src,dst or the IV > than you have to do it by yourself :( It has to be multiple of blocksize. I.e. it is impossible to crypt one byte - hardware will stall, DES test provides two bytes as input - this will not work. If that is going to be handled in driver, then it will relocate. I'm not sure it is the right decision. -- Evgeniy Polyakov - To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html