This is a follow-up of sorts to my question: Does iPhone support hardware-accelerated AES Encryption?. After further analysis and hackery, I have determined that the iOS CommonCrypto supports hardware acceleration only for the AES-CBC mode (Cipher Block Chaining), but not AES-CTR (Counter) or AES-ECB (Electronic Codebook) modes. Although this differs from the open sourced code: http://opensource.apple.com/source/CommonCrypto/CommonCrypto-36064/Source/GladmanAES/ccNewGladman.c.
So this seems like an additional "fix" on top of what's available publicly. So I'm curious to know what the capabilities of the hardware are and if Apple is actually preventing the application developers from using all the features of the hardware chip.
I have looked at the usual suspects (Chipworks & iFixit) for this info but no luck.
At least some of the hardware accelerated AES and SHA is coming from the CPU capabilities of ARMv8-a and above. ARMv8-a is ARM-64, and you can see it via:
With
__ARM_FEATURE_CRYPTO
in effect, you get access to the arm assembler instructions and arm intrinisics customarily found in<arm_neon.h>
and<arm_acle.h>
.I don't know whether this is the same AES circuit on the DMA data path from storage to memory. I believe this AES is part of the Data Protection API announced in iOS 4.3.
You might be able to find the answer in Jean-Baptiste Bédrune and Jean Sigwald iPhone data protection in depth; and Dino Zavi's Apple iOS 4 Security Evaluation.