Jan-Philipp Litza

aes-arm and sha1-arm for Raspberry Pi/kernel 3.6

I just noticed that the “current” kernel (or, to be more precise, every kernel since 3.7) contains an assembler implementation of AES and SHA1 for ARM. Regrettably, the stock kernel for the Raspberry Pi is 3.6, thus this implementation that claims to be twice as fast as the generic version isn’t available there yet.

But because this seemed like a nice little brush-up of my kernel compilation knowledge I attempted to backport this feature to the 3.6 kernel and actually succeeded because it is pretty stand-alone. So I managed to compile these two modules that every were compatible to the already installed kernel (but I had to compile the whole kernel nonetheless by pretty much following this little post). So, if anybody is interested, here is the patch for the 3.6 kernel that adds the modules aes-arm and sha1-arm.

Update: After testing the performance a little bit, I am quite content: While copying a file from an AES-encrypted LUKS volume over NFS, I achived ~2 MB/s with aes-generic and up to 3 MB/s with aes-arm. That’s no magical increase by factor 100 and not a really bulletproof benchmark, but still it’s an improvement.

Update 2: The default kernel for the Raspberry Pi was updated to 3.10, but the option is disabled as of yet. I filed an issue at the Github project to enable it by default and hope for the best. ☺

Update 3: The options got enabled and are now available via rpi-update. That was fast! ☺