Benchmark demonstration program for mbed TLS. The canonical source for this example lives at https://github.com/ARMmbed/mbed-os-example-tls

Mbed TLS Benchmark example on Mbed OS

This application benchmarks the various cryptographic primitives offered by Mbed TLS.

Getting started

Building with Mbed CLI

If you'd like to use Mbed CLI to build this, then you should set up your environment if you have not done so already. For instructions, refer to the main readme. The instructions on this page relate to using the developer.mbed.org Online Compiler

Import the program in to the Online Compiler, select your board from the drop down in the top right hand corner and then compile the application. Once it has built, you can drag and drop the binary onto your device.

Monitoring the application

The output in the terminal window should be similar to this:

terminal output

  SHA-256                  :       1673 Kb/s,         70 cycles/byte
  SHA-512                  :        546 Kb/s,        215 cycles/byte
  AES-CBC-128              :       1428 Kb/s,         82 cycles/byte
  AES-CBC-192              :       1260 Kb/s,         93 cycles/byte
  AES-CBC-256              :       1127 Kb/s,        104 cycles/byte
  AES-GCM-128              :        486 Kb/s,        242 cycles/byte
  AES-GCM-192              :        464 Kb/s,        253 cycles/byte
  AES-GCM-256              :        445 Kb/s,        264 cycles/byte
  AES-CCM-128              :        610 Kb/s,        192 cycles/byte
  AES-CCM-192              :        547 Kb/s,        214 cycles/byte
  AES-CCM-256              :        496 Kb/s,        237 cycles/byte
  CTR_DRBG (NOPR)          :       1139 Kb/s,        102 cycles/byte
  CTR_DRBG (PR)            :        826 Kb/s,        142 cycles/byte
  HMAC_DRBG SHA-256 (NOPR) :        193 Kb/s,        611 cycles/byte
  HMAC_DRBG SHA-256 (PR)   :        170 Kb/s,        695 cycles/byte
  RSA-2048                 :      28 ms/ public
  RSA-2048                 :     953 ms/private
  RSA-4096                 :      93 ms/ public
  RSA-4096                 :    5327 ms/private
  ECDSA-secp384r1          :     451 ms/sign
  ECDSA-secp256r1          :     304 ms/sign
  ECDSA-secp384r1          :     863 ms/verify
  ECDSA-secp256r1          :     594 ms/verify
  ECDHE-secp384r1          :     829 ms/handshake
  ECDHE-secp256r1          :     566 ms/handshake
  ECDHE-Curve25519         :     533 ms/handshake
  ECDH-secp384r1           :     407 ms/handshake
  ECDH-secp256r1           :     281 ms/handshake
  ECDH-Curve25519          :     268 ms/handshake

DONE
Committer:
mbed_official
Date:
Wed Jun 07 17:00:05 2017 +0100
Revision:
33:0af60cd5226d
Parent:
31:fc594198ff6e
Child:
41:86321a0293ee
Merge pull request #88 from andresag01/no-cycle-counter

benchmark: remove cycle counter
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-tls

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 2:c300a1d54523 1 # mbed TLS Benchmark example on mbed OS
mbed_official 2:c300a1d54523 2
mbed_official 2:c300a1d54523 3 This application benchmarks the various cryptographic primitives offered by mbed TLS.
mbed_official 2:c300a1d54523 4
mbed_official 5:3d34dd697ad9 5 ## Getting started
mbed_official 2:c300a1d54523 6
mbed_official 2:c300a1d54523 7 Set up your environment if you have not done so already. For instructions, refer to the [main readme](../README.md).
mbed_official 2:c300a1d54523 8
mbed_official 19:6d7d73044c60 9 You can also compile this example with the [mbed Online Compiler](https://developer.mbed.org/compiler/) by using [this project](https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-tls-benchmark).
mbed_official 19:6d7d73044c60 10
mbed_official 2:c300a1d54523 11 ## Monitoring the application
mbed_official 2:c300a1d54523 12
mbed_official 2:c300a1d54523 13 The output in the terminal window should be similar to this:
mbed_official 2:c300a1d54523 14
mbed_official 2:c300a1d54523 15 ```
mbed_official 33:0af60cd5226d 16 SHA-256 : 1673 KB/s
mbed_official 33:0af60cd5226d 17 SHA-512 : 546 KB/s
mbed_official 33:0af60cd5226d 18 AES-CBC-128 : 1428 KB/s
mbed_official 33:0af60cd5226d 19 AES-CBC-192 : 1260 KB/s
mbed_official 33:0af60cd5226d 20 AES-CBC-256 : 1127 KB/s
mbed_official 33:0af60cd5226d 21 AES-GCM-128 : 486 KB/s
mbed_official 33:0af60cd5226d 22 AES-GCM-192 : 464 KB/s
mbed_official 33:0af60cd5226d 23 AES-GCM-256 : 445 KB/s
mbed_official 33:0af60cd5226d 24 AES-CCM-128 : 610 KB/s
mbed_official 33:0af60cd5226d 25 AES-CCM-192 : 547 KB/s
mbed_official 33:0af60cd5226d 26 AES-CCM-256 : 496 KB/s
mbed_official 33:0af60cd5226d 27 CTR_DRBG (NOPR) : 1139 KB/s
mbed_official 33:0af60cd5226d 28 CTR_DRBG (PR) : 826 KB/s
mbed_official 33:0af60cd5226d 29 HMAC_DRBG SHA-256 (NOPR) : 193 KB/s
mbed_official 33:0af60cd5226d 30 HMAC_DRBG SHA-256 (PR) : 170 KB/s
mbed_official 2:c300a1d54523 31 RSA-2048 : 28 ms/ public
mbed_official 2:c300a1d54523 32 RSA-2048 : 953 ms/private
mbed_official 2:c300a1d54523 33 RSA-4096 : 93 ms/ public
mbed_official 2:c300a1d54523 34 RSA-4096 : 5327 ms/private
mbed_official 2:c300a1d54523 35 ECDSA-secp384r1 : 451 ms/sign
mbed_official 2:c300a1d54523 36 ECDSA-secp256r1 : 304 ms/sign
mbed_official 2:c300a1d54523 37 ECDSA-secp384r1 : 863 ms/verify
mbed_official 2:c300a1d54523 38 ECDSA-secp256r1 : 594 ms/verify
mbed_official 2:c300a1d54523 39 ECDHE-secp384r1 : 829 ms/handshake
mbed_official 2:c300a1d54523 40 ECDHE-secp256r1 : 566 ms/handshake
mbed_official 2:c300a1d54523 41 ECDHE-Curve25519 : 533 ms/handshake
mbed_official 2:c300a1d54523 42 ECDH-secp384r1 : 407 ms/handshake
mbed_official 2:c300a1d54523 43 ECDH-secp256r1 : 281 ms/handshake
mbed_official 2:c300a1d54523 44 ECDH-Curve25519 : 268 ms/handshake
mbed_official 2:c300a1d54523 45
mbed_official 2:c300a1d54523 46 DONE
mbed_official 2:c300a1d54523 47 ```