Results 1 to 2 of 2

Thread: AES support on arm64?

  1. #1
    Join Date
    May 2007
    Location
    Florida
    Beans
    67
    Distro
    Ubuntu 18.04 Bionic Beaver

    Question AES support on arm64?

    Hello! I recently installed Ubuntu 18.04.2 Server on my Raspberry Pi 3 B+ using the official image (see here) and have confirmed that the 64-bit kernel is active:
    Code:
    katakaio@ubuntu:~$ uname -a
    Linux ubuntu 4.15.0-1032-raspi2 #34-Ubuntu SMP PREEMPT Wed Feb 6 11:46:23 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
    One of my primary reasons for using the arm64 image was because ARMv8 processors include dedicated instructions for AES and other encryption protocols (see here and here). I assumed that the 64-bit Ubuntu Server image would be able to access these instructions, but AES doesn't appear as a feature in my /proc/cpuinfo:
    Code:
    katakaio@ubuntu:~$ cat /proc/cpuinfo processor    : 0
    BogoMIPS    : 38.40
    Features    : fp asimd evtstrm crc32 cpuid
    CPU implementer    : 0x41
    CPU architecture: 8
    CPU variant    : 0x0
    CPU part    : 0xd03
    CPU revision    : 4
    I'm used to seeing "aes" as a flag when I run that same command on my x64 machines, although I'm new to ARM and realize that there may be differences. Can anyone confirm that AES instructions are supported in 18.04.2 on arm64 - or advise me as to how I might confirm that they're in use? Thank you!

  2. #2
    Join Date
    May 2007
    Location
    Florida
    Beans
    67
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: AES support on arm64?

    After some sleuthing, I discovered the answer to my question: while some ARMv8 processors include optional cryptography acceleration for AES and SHAx, the Raspberry Pi 3 does not. This is consistent with the output of cat /proc/cpuinfo that I reported earlier.

    However, there is some good news! The RPi3 does offer some modest crypto acceleration by way of NEON/SIMD:
    Code:
    ubuntu@ubuntu:~$ sort -u /proc/crypto | grep module
    module       : aes_arm64
    module       : aes_neon_blk
    module       : aes_neon_bs
    module       : crc32_ce
    module       : ecdh_generic
    module       : kernel
    The ability for the RPi3 to accelerate AES via NEON is also described at length here.

    To see if this has any real impact on crypto performance, I ran a few openssl speed benchmarks with and without the EVP functions and observed a ~25% performance increase with the -evp flag set; I am assuming that this is enabling NEON/SIMD support, but that's conjecture on my part.

    So, the answer to my original question is yes, there is acceleration for AES on the RPi3's ARMv8, but much less than one might expect from a Intel/AMD proc with true crypto acceleration. I hope this helps anyone else who wondered about this!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •