Multi-block operations with VIA Padlock

Michal Ludvig michal at logix.cz
Tue Apr 19 05:34:54 UTC 2005


Herbert Xu wrote:
> On Mon, Apr 18, 2005 at 12:48:53AM +1200, Michal Ludvig wrote:
> 
>>http://www.logix.cz/michal/devel/padlock/crypto-dev-padlock-2.6.10.diff
>>BTW it is a whole driver, not a diff against the single-block version.
>>More patches are at http://www.logix.cz/michal/devel/padlock (e.g. the
>>"preference patch" which I still think is usefull).
> 
> [...]
> 
> However, I think your API changes will need some adjustments though.
> For example, would I be right in saying that if I supplied a one
> megabyte request to the patched crypt function that it will allocate
> two one megabyte buffers? That is unlikely to work :)

Ehm ... yes. That's true. Fortunately that never happend to me neither
with IPsec nor with dm-crypt :-) Actually the buffers in these two
subsystems are usually correctly aligned and don't need to be realigned
at all.

> In general I would say that doing more than one page only makes sense
> if we can go straight from the source to the destination without
> copying.  This would include in-place operations if the implementation
> supports it, does the Padlock support in place encryption?

Yes it does.

> If we have to do copying then we should fall back to page-by-page
> operations.  In order to be resilient we probably should fall back
> to block-by-block operations if we can't get hold of a page.

That should be done in the generic API part, not in the padlock-specific
I guess... Are you going to work on it?

Michal Ludvig
-- 
* Personal homepage: http://www.logix.cz/michal


More information about the CryptoAPI mailing list