linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* XTS template wrapping question
@ 2019-08-09 11:39 Pascal Van Leeuwen
  2019-08-09 14:18 ` Pascal Van Leeuwen
  2019-08-09 16:46 ` Eric Biggers
  0 siblings, 2 replies; 7+ messages in thread
From: Pascal Van Leeuwen @ 2019-08-09 11:39 UTC (permalink / raw)
  To: linux-crypto, herbert, davem, Eric Biggers

Herbert, Eric,

While working on the XTS template, I noticed that it is being used 
(e.g. from testmgr, but also when explictly exported from other drivers)
as e.g. "xts(aes)", with the generic driver actually being 
"xts(ecb(aes-generic))". 

While what I would expect would be "xts(ecb(aes))", the reason being
that plain "aes" is defined as a single block cipher while the XTS
template actually efficiently wraps an skcipher (like ecb(aes)).
The generic driver reference actually proves this point.

The problem with XTS being used without the ecb template in between,
is that hardware accelerators will typically advertise an ecb(aes)
skcipher and the current approach makes it impossible to leverage
that for XTS (while the XTS template *could* actually do that
efficiently, from what I understand from the code ...).
Advertising a single block "aes" cipher from a hardware accelerator
unfortunately defeats the purpose of acceleration.

I also wonder what happens if aes-generic is the only AES 
implementation available? How would the crypto API know it needs to 
do "xts(aes)" as "xts(ecb(aes))" without some explicit export?
(And I don't see how xts(aes) would work directly, considering 
that only seems to handle single cipher blocks? Or ... will
the crypto API actually wrap some multi-block skcipher thing 
around the single block cipher instance automatically??)

Regards,
Pascal van Leeuwen
Silicon IP Architect, Multi-Protocol Engines @ Verimatrix
www.insidesecure.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-09 21:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 11:39 XTS template wrapping question Pascal Van Leeuwen
2019-08-09 14:18 ` Pascal Van Leeuwen
2019-08-09 15:06   ` Pascal Van Leeuwen
2019-08-09 17:06     ` Eric Biggers
2019-08-09 21:55       ` Pascal Van Leeuwen
2019-08-09 16:46 ` Eric Biggers
2019-08-09 21:49   ` Pascal Van Leeuwen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).