xbmc-imx6 / xbmc

XBMC Main Repository
http://xbmc.org
Other
32 stars 5 forks source link

Utilize CAAM hardware cryptographic engine CESA co-processor #84

Open Hedda opened 10 years ago

Hedda commented 10 years ago

Hope it is OK if I add this request for tracking here:

i.MX 6 SoC contain CAAM (Cryptographic Acceleration and Assurance Module) hardware engine supporting ARM's TrustZone can be used to hardware accelerate cryptographic decryption decipher and encryption cipher.

Best real-world examples to advantage of hardware accelerators for this on XBMC's Linux distros are transparently using it for dependent libraries like OpenSSL, OpenSSH, GnuTLS, dm-crypt, kcryptd, dm-mod, and/or luks via cryptodev library API

http://cryptodev-linux.org (Comparisons: http://cryptodev-linux.org/comparison.html )

Utilize hardware cryptographic engine CESA co-processor for hardware acceleration encryption / decryption crypto and ciphers calculations tasks such as SSL, SCP, SSH, AES, TLS, DES, 3DES, SHA-1, MD5, hashes, dm-crypt, luks, etc. (such as hardware decryption with OpenSSL, OpenSSH, and GnuTLS libraries via CryptoDev to offload cryptographic tasks from CPU and therefore every dependency module that XBMC utilizes which support CryptoDev cryptographic accelerator drivers via /dev/crypto)

The old CuBox usage example: http://www.solid-run.com/archive/phpbb/viewtopic.php?f=9&t=634

wolfgar commented 10 years ago

Hi Hedda,

I basically totally agree that using crypto hw engine would just be fine.

I have the following remarks :

Kind regards Stéphan

CrawX commented 10 years ago

I agree with @wolfgar, this issue doesn't really belong to xbmc.

Still, I tested CAAM some time ago and ran some benchmarks.

My result was (copied from this particular thread): "So while CAAM could be useful in terms of power-usage (I did not test this), its not very useful for performance (for now...)."

This conclusion only relates to the raw performance figures, I did not include the effort needed to actually get it integrated into applications (which mostly use openssl). IIRC openssl-cryptodev kinda worked but I remember having some problems...

Cheers

Hedda commented 10 years ago

Ok so maybe this request more belongs to upstream kernel and downstream Linux distros then or?

@wolfgar, standard libraries do not have support, instead have to use via cryptodev or NCR API's http://cryptodev-linux.org http://cryptodev-linux.org/ncr.html

wolfgar commented 10 years ago

Hi @CrawX : Thanks for your link and testing. I was definitively too pessimistic : If I understand properly, contrary to 3.0.35 drivers, the 3.10.17 drivers can be used through cryptodev and thus openssl benefits from them. Yet, Your figures are indeed disappointing. At least if it is not about being faster, using caam off loads the CPU which can do something else by the time...

@Hedda : If my understanding is correct, caam drivers are all good in 3.10.17 so it would be only about the distro and packaging cryptodev ...

piotrasd commented 10 years ago

this could by useful for descrabling channels - latest tvheadend with SAT>IP using AES over openssl lib ,less CPU load