All of lore.kernel.org
 help / color / mirror / Atom feed
* AES-NI: slower than aes-generic?
@ 2016-05-26 16:10 Stephan Mueller
  2016-05-26 17:25 ` Jeffrey Walton
  2016-05-26 18:20 ` Sandy Harris
  0 siblings, 2 replies; 14+ messages in thread
From: Stephan Mueller @ 2016-05-26 16:10 UTC (permalink / raw)
  To: linux-crypto

Hi,

for the DRBG and the LRNG work I am doing, I also test the speed of the DRBG. 
The DRBG can be considered as a form of block chaining mode on top of a raw 
cipher.

What I am wondering is that when encrypting 256 16 byte blocks, I get a speed 
of about 170 MB/s with the AES-NI driver. When using the aes-generic or aes-
asm, I get up to 180 MB/s with all else being equal. Note, that figure 
includes a copy_to_user of the generated data.

To be precise, the code does the following steps:

1. setkey

2. AES encrypt 256 blocks and copy_to_user

3. Use AES to generate a new key and start at step 1.

I am wondering why the AES-NI driver is slower than the C/ASM implementations 
given that all else is equal.

Note, if I have less blocks in step 2 above, AES-NI is becoming faster. E.g. 
if I have 8 blocks or just one block in step 2 above, AES-NI is faster by 10 
or 20%.

Ciao
Stephan
-- 
atsec information security GmbH, Steinstraße 70, 81667 München, Germany
P: +49 89 442 49 830 - F: +49 89 442 49 831
M: +49 172 216 55 78 - HRB: 129439 (Amtsgericht München)
US: +1 949 545 4096
GF: Salvatore la Pietra, Staffan Persson
atsec it security news blog - atsec-information-security.blogspot.com

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

end of thread, other threads:[~2016-06-08 12:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-26 16:10 AES-NI: slower than aes-generic? Stephan Mueller
2016-05-26 17:25 ` Jeffrey Walton
2016-05-26 17:30   ` Stephan Mueller
2016-05-26 18:14     ` Stephan Mueller
2016-05-26 18:20 ` Sandy Harris
2016-05-26 18:49   ` Stephan Mueller
2016-05-26 19:15     ` Sandy Harris
2016-05-27  2:14     ` Theodore Ts'o
2016-05-27  7:08       ` Stephan Mueller
2016-05-27 20:40       ` Jeffrey Walton
2016-06-08 12:21       ` Stephan Mueller
2016-05-28  0:28     ` Aaron Zauner
2016-05-29 19:51       ` Stephan Mueller
2016-05-30  4:08         ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.