[Cryptography] How can I make use of the AES hardware on new CPUs?

Miroslav Kratochvil exa.exa at gmail.com
Sat Mar 15 18:07:58 EDT 2014


> First, how do I get at them?
>


I would take the easiest opensource approach and look (steal) how the
others do.

For example, OpenSSL does something similar here:
https://github.com/openssl/openssl/blob/master/crypto/aes/asm/aesni-x86_64.pl


And Intel has a bunch of docs here:
http://software.intel.com/en-us/articles/intel-advanced-encryption-standard-instructions-aes-ni/
(There's even sample code)



> Second, is there a way to detect whether or not that hardware
> is present, so that I can create something that may run more
> slowly but at least doesn't crash horribly if run on an
> earlier CPU without an AES instruction built in?
>
>

>From this direction, I strongly recommend that you use preexisting
crypto library that already implements this (also with the fallback).
There's also a nice (my personal favourite) article on that:
http://www.cs.berkeley.edu/~daw/teaching/cs261-f12/misc/if.html

Hope that helps,
-mk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.metzdowd.com/pipermail/cryptography/attachments/20140315/ef222912/attachment.html>


More information about the cryptography mailing list