hardware crypto (padlock, aesni) support for 64bit cpus

Stefan Krüger stadtkind2 at gmx.de
Fri Nov 9 16:47:19 CET 2012


On Thu, 08 Nov 2012, Stefan Krüger wrote:

> Hi,
> 
> I'm using libgcrypt on a 64bit Padlock CPU and noticed hw crypto support does
> not kick in.
> 
> After some digging I found that src/hwfeatures.c only works when __i386__ is
> defined (and SIZEOF_UNSIGNED_LONG is 4, which happens to be 8 on __amd64),
> which is not the case with 64bit AES-NI CPUs from Intel (and nowadays even
> AMD) and newer chips from Via.
> 
> Sad thing is, I'm not a programmer but I could test a patch on a 64bit Via
> Nano CPU (and maybe even 64bit AMD CPUs with AES support) if someone else
> feels free to do it.
> 
> Regards,
> 
> Stefan

Hi,

sorry for replying directly to my mail. I'm not subscribed that's why I could
only read your answers via mail archive.

Anyway, I applied your patch from
http://lists.gnupg.org/pipermail/gcrypt-devel/2012-April/001944.html and,
well…, shouldn't these numbers be diffrent somehow?

$ ./tests/benchmark --disable-hwf padlock-aes --cipher-repetitions 100 --alignment 16 cipher aes128
Running each test 100 times.
                ECB/Stream         CBC             CFB             OFB
CTR      
             --------------- --------------- --------------- ---------------
---------------
AES           2080ms  2090ms  1220ms  1170ms  1170ms  1160ms  2540ms  2530ms
2890ms  2900ms

$ ./tests//benchmark --cipher-repetitions 100 --alignment 16 cipher aes128                        
Running each test 100 times.
                ECB/Stream         CBC             CFB             OFB
CTR      
             --------------- --------------- --------------- ---------------
---------------
AES           2080ms  2090ms  1220ms  1160ms  1170ms  1160ms  2530ms  2530ms
3010ms  3000ms


Regards,

Stefan



More information about the Gcrypt-devel mailing list