1.1 Speed Test

Introduction

Extensible crypto module speed test framework.

Description

This demonstration exercises several cryptographic functions, including TDES, DES, SHA 128-512, AES, and RSA, to verify that the software or hardware is performing correctly and to determine the speed of each function for various data sizes. Data is taken from Microchip example code, NSA test vectors, and other sources.

Building the Application

To build the application, the project corresponding to the test hardware must be opened in MPLAB X IDE. The following table lists projects and supported configurations. The parent folder for these projects is crypto_apps_speed_test\apps\speed_tests\firmware.

MPLAB X IDE Projects

This table lists the name and location of the MPLAB X IDE project folder for the demonstration.
Project NameBSP UsedDescription
sam_e54_xplained_pro_hw.Xsam_e54_xplained_proSpeedTest project using the SAME54 and hardware cryptography
sam_e54_xplained_pro_hwsw.Xsam_e54_xplained_proSpeedTest project using the SAME54 and software cryptography
sam_e70_xplained_ultra_hw.X sam_e70_xplained_ultraSpeedTest project using the SAME70 and hardware cryptography
sam_e70_xplained_ultra_sw.Xsam_e70_xplained_ultraSpeedTest project using the SAME70 and software cryptography
sam_l11_xplained_pro_hw.Xsam_l11_xplained_proSpeedTest project using the SAML11 and hardware cryptography
sam_l11_xplained_pro_hwsw.Xsam_l11_xplained_proSpeedTest project using the SAML11 and software cryptography
sam_l21_xplained_pro_hw.Xsam_l21_xproSpeedTest project using the SAML21 and hardware cryptography
sam_l21_xplained_pro_sw.Xsam_l21_xproSpeedTest project using the SAML21 and software cryptography
pic32mz_wifi_curiosity_hw.Xpic32mz_wifi_curiositySpeedTest project using the PIC32MZ-W1 and hardware cryptography
pic32mz_wifi_curiosity_sw.Xpic32mz_wifi_curiositySpeedTest project using the PIC32MZ-W1 and software cryptography
sam_9x60_ek_hw.Xsam_9x60_ekSpeedTest project using the SAM9X60 and hardware cryptography
sam_9x60_ek_sw.Xsam_9x60_ekSpeedTest project using the SAM9X60 and software cryptography
sam_a5d2_wlsom1_ek1_hw.Xsam_a5d2_wlsom1_ek1SpeedTest project using the ATSAMA5D27-WLSOM1 and hardware cryptography
sam_a5d2_wlsom1_ek1_sw.Xsam_a5d2_wlsom1_ek1SpeedTest project using the ATSAMA5D27-WLSOM1 and software cryptography
sam_a5d2_xplained_ultra_hw.Xsam_a5d2_xplained_ultraSpeedTest project using the ATSAMA5D2C-XULT and hardware cryptography
sam_a5d2_xplained_ultra_sw.Xsam_a5d2_xplained_ultraSpeedTest project using the ATSAMA5D2C-XULT and software cryptography
sam_rh71_ek_hw.Xsam_rh71_ekSpeedTest project using the SAMRH71F20-EK and hardware cryptography
sam_rh71_ek_sw.Xsam_rh71_ekSpeedTest project using the SAMRH71F20-EK and software cryptography

Each application is built by using the standard MPLAB X IDE buttons.

Running the Demonstration

  1. Connect the board to the PC as described in the 'Configuring the Hardware' section.
  2. Configure a terminal application (ex. Tera Term) to access the newly attached serial port:
    • 115,200 bps
    • 8 data bits
    • No parity
    • 1 stop bit
    • No flow control
  3. Compile the demonstration using MPLAB X
    • Use the standard MPLAB X IDE Buttons
  4. Observe or capture the output from the serial console.

Application Output

The demonstration runs in two phases. In the first phase, each data set is exercised and the results are checked against known-good cipher text (when available). Encryption drivers also decrypt the cipher and verify against the original plain text. These calculations are not timed.

The second phase repeats each data set multiple times to get a statistical average of run-time, but does not check the results. Most functions are repeated 1000 times, but long-running operations (like RSA) may have as few as 5 or 10 repetitions.

Test results output lines begin with ">>". The 2nd phase output is in CSV file format and can be imported to Excel, including any error or warning messages. Each project will have different timing results.

An example result is shown in SAML21_example_output.txt.