Technical Demo

AES-GCM, AES-XTS and SHA-2 Offload for Linux on PolarFire SoC

StealthAES and StealthSHA behind StealthDMA on the PolarFire SoC Icicle Kit, with standard Linux software on top

PolarFire SoC combines four 64-bit RISC-V application cores with FPGA fabric, which makes it a natural platform for network and storage equipment that must encrypt everything it sends and stores. The U54 cores have no cryptographic instructions, so in software AES-GCM runs at about 4.7 MB/s on this device and takes most of a core to do it. This post shows what changes when the cryptography moves into the fabric, using StealthAES and StealthSHA behind StealthDMA on the PolarFire SoC Icicle Kit, with standard Linux software on top.

The Design

StealthDMA reads data from DDR memory, passes it through the cryptographic engines and writes the result back, so the processor only prepares descriptors and handles the completion. In this design it carries StealthAES with two AES engines and StealthSHA. StealthAES provides AES-GCM, AES-XTS and the SP 800-38A modes, including CBC and CTR, with 128-bit and 256-bit keys. StealthSHA provides SHA-224, SHA-256, SHA-384 and SHA-512 with HMAC. The engines connect to the processor through one AXI4 master port into the memory subsystem and one AXI4-Lite register interface.

At the 100 MHz clock of the fabric interface, the two AES engines reach 213 MB/s, or 1.7 Gbps, for AES-GCM and AES-XTS, and one AES engine reaches 107 MB/s. The table gives the area of StealthAES, StealthSHA and StealthDMA with one AES engine and with two. It also gives the area of the whole Icicle Kit design, which adds the connection of the subsystem to the processor and the PCIe controller for the kit's NVMe drive.

Design4LUTsFlip-flopsLSRAM blocksuSRAM blocksLogic of an MPFS250T
One AES engine
StealthAES, StealthSHA and StealthDMA33,02315,40819113 %
Whole Icicle Kit design37,75620,023252215 %
Two AES engines
StealthAES, StealthSHA and StealthDMA41,50216,776273516 %
Whole Icicle Kit design46,27121,400335618 %

Standard Linux Interfaces

The StealthCores Linux driver registers the engines with the Linux kernel crypto API, so kernel users such as IPsec, MACsec, kernel TLS, dm-crypt and the SMB server and client pick them up without any change. An OpenSSL 3 provider makes the same engines available to OpenSSL applications such as OpenSSH, and a module of wolfCrypt crypto callbacks does the same for wolfSSL. Several processes and kernel users can share the engines at the same time, and the driver loads the key of each request into the engine when it changes.

Measured Performance

The table compares each use with the same software running on the four U54 cores at 600 MHz without the engines. The software figures are those of the Linux kernel, OpenSSL 3.5.7 and wolfSSL 5.9.4 as built for this platform, with wolfSSL's optimized code for 64-bit RISC-V. The table gives the rates with one AES engine and with two, and the speedup of two engines over software. Where a row gives two figures, they are the two directions of the transfer.

UseSoftwareOne AES engineTwo AES enginesSpeedup with two engines
The engines through the Linux driver
AES-256-GCM, 64 KiB requests from eight threads–100 MB/s186 MB/s (1.5 Gbps)–
AES-256-XTS, 64 KiB requests from eight threads–101 MB/s185 MB/s–
SHA-512, 64 KiB requests from eight threads–151 MB/s–
OpenSSL, 64 KiB buffers
AES-256-GCM4.7 MB/s70 MB/s102 MB/s22x
AES-256-XTS6.2 MB/s86 MB/s141 MB/s23x
AES-256-CTR6.4 MB/s85 MB/s13x
AES-256-CBC7.0 MB/s83 MB/s12x
SHA-38414.8 MB/s81 MB/s5.5x
wolfSSL, 64 KiB buffers
AES-256-GCM2.5 MB/s86 MB/s142 MB/s57x
SHA-38415 MB/s56 MB/s3.7x
Network security
IPsec ESP with AES-256-GCM, 9000-byte MTU1.2 MB/s32 MB/s37 MB/s30x
IPsec ESP with AES-256-GCM, 1500-byte MTU1.1 MB/s7.5 MB/s8.7 MB/s7.9x
MACsec with GCM-AES-256, 9000-byte MTU1.2 MB/s31 MB/s33 MB/s27x
MACsec with GCM-AES-256, 1500-byte MTU1.1 MB/s11 MB/s11 MB/s10x
Kernel TLS 1.3 with AES-256-GCM2.3 MB/s21 MB/s24 MB/s10x
TLS 1.3 server with OpenSSL, send / receive4.0 / 4.2 MB/s19 / 22 MB/s21 / 25 MB/s5.3x / 6.0x
TLS 1.3 server with wolfSSL, send / receive2.3 / 2.4 MB/s27 / 32 MB/s31 / 38 MB/s13x / 16x
Storage encryption, LUKS2 with AES-256-XTS on NVMe
Four streams, write / read21 / 22 MB/s90 / 96 MB/s96 / 145 MB/s4.6x / 6.6x
One stream, write / read19 / 21 MB/s60 / 80 MB/s67 / 117 MB/s3.5x / 5.6x
File sharing, SMB 3.1.1 with AES-128-GCM
A PC writing to and reading from the kit7.6 / 5.2 MB/s41 / 33 MB/s43 / 35 MB/s5.7x / 6.7x
SSH, one session
AES-256-GCM, upload / download3.0 / 3.4 MB/s13 / 18 MB/s13 / 21 MB/s4.4x / 6.1x
AES-256-CTR, upload / download2.6 / 2.8 MB/s10 / 13 MB/s4.0x / 4.7x

The first three rows show the engines through the Linux driver alone, with several requests in flight. Large requests keep the engines close to their limits of 213 MB/s with two AES engines and 107 MB/s with one. The difference is the time the processor needs to prepare and complete each request. Smaller requests take a larger share of that time. With two AES engines, a single thread sending 4 KiB requests reaches 72 MB/s, and one sending 16 KiB requests reaches 134 MB/s. With one AES engine the same threads reach 54 MB/s and 82 MB/s. The SP 800-38A modes reach 94 MB/s with 64 KiB requests from eight threads.

The rows below the libraries include all of each protocol's own work on the processor, which the engines do not change. IPsec and MACsec gain the most, because the kernel spends most of its time in the cipher when it runs in software. With 1500-byte packets the per-packet work of the kernel and the driver sets the limit rather than the engines.

Through the driver, one AES engine runs AES-GCM and AES-XTS at about 100 MB/s, which is a little over half the rate of two engines. The libraries keep 60 to 70 percent of their rate with two engines. Most protocols keep 85 to 100 percent, because the work of each protocol on the processor limits them more than the engines do. LUKS2 reads are the exception, because their rate with two engines is more than one engine can decrypt. With one engine they reach 96 MB/s. The SP 800-38A modes use a single AES engine in both configurations, and StealthSHA is the same in both, so their rows and the row for SSH with AES-CTR give one figure for both.

Storage Encryption With LUKS2

The engines register AES-XTS with the kernel, so dm-crypt uses them for a LUKS2 volume as soon as the driver is loaded. The table's figures are for the kit's NVMe drive with 4 KiB sectors. With four streams the processor load falls from 99 percent of the four cores in software to 40 percent.

File Sharing With SMB 3

The Linux kernel's SMB server, ksmbd, encrypts SMB 3.1.1 sessions through the kernel crypto API, so the engines carry the encryption of every share that requires it. The table's figures are for a PC that copies a 256 MiB file to and from an encrypted share on the kit. AES-256-GCM gives the same rates.

SSH

OpenSSH uses the engines through the OpenSSL provider for both of its AES cipher families. The table's rows are for the ciphers that OpenSSH names aes256-gcm@openssh.com and aes256-ctr. With AES-256-GCM, the encryption that SSH performs on each 32 KiB packet runs at 81 MB/s with two AES engines and 58 MB/s with one, against 4.0 MB/s in software. A single session is limited by the SSH server process, which runs in one thread on one U54 core, and not by the engines. Several sessions at once share the engines, which handle 16 KiB requests from eight threads at 171 MB/s with two AES engines and 95 MB/s with one.

wolfSSL

wolfSSL applications reach the engines through wolfCrypt's crypto callbacks, with no change to the application. The wolfSSL rows compare the engines with wolfSSL's own software, so their speedups differ from those of OpenSSL. The TLS rows are for a server on the kit that sends a 64 MiB file to a PC and receives one from it.

Optional Side-Channel Countermeasures

StealthAES is also available in a countermeasure configuration that protects the AES keys against power and electromagnetic side-channel attacks. StealthAES's countermeasures are tested beyond 1 billion traces with TVLA. In a countermeasure configuration measured on the same Icicle Kit, AES-GCM, AES-XTS and SHA-2 ran at the same rates as without countermeasures. The countermeasures add area, and the amount depends on the configuration.

Availability

StealthAES, StealthSHA and StealthDMA are available for PolarFire and PolarFire SoC, and for the other FPGA families that StealthCores supports, as Verilog or VHDL. The Linux driver, the OpenSSL provider and a Yocto layer for these cores are available as StealthAPI for Linux. Contact StealthCores for the datasheets and an evaluation.

📄 StealthAES 📄 StealthSHA
Microchip Technology

StealthCores is a member of the Microchip Partner Program. Our IP is listed on Microchip's partner pages for StealthAES and StealthMem.

About StealthCores

StealthCores develops advanced security IP for FPGAs and ASICs, delivering practical, high-performance cryptographic solutions with built-in countermeasures against side-channel attacks. Backed by decades of industry experience and purpose-built IP, StealthCores enables customers to secure critical systems with confidence. Learn more at www.stealthcores.com or contact us at info@stealthcores.com.

Evaluate Cryptographic Offload on PolarFire SoC

Talk to us about StealthAES, StealthSHA and StealthDMA for your PolarFire SoC design: configurations, integration and performance on your workloads.

Contact Our Team Explore StealthAES