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

mbedtls_config.h

Committer:
mbed_official
Date:
2019-11-18
Revision:
91:a1f955b90b9a
Parent:
83:c40c51a46813

File content as of revision 91:a1f955b90b9a:

/*
 *  Copyright (C) 2018, Arm Limited, All Rights Reserved
 *  SPDX-License-Identifier: Apache-2.0
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may
 *  not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *  This file is part of Mbed TLS (https://tls.mbed.org)
 */

#if !defined(MBEDTLS_MD4_C)
#define MBEDTLS_MD4_C
#endif

#if !defined(MBEDTLS_MD5_C)
#define MBEDTLS_MD5_C
#endif

#if !defined(MBEDTLS_RIPEMD160_C)
#define MBEDTLS_RIPEMD160_C
#endif

#if !defined(MBEDTLS_SHA1_C)
#define MBEDTLS_SHA1_C
#endif

#if !defined(MBEDTLS_SHA256_C)
#define MBEDTLS_SHA256_C
#endif

#if !defined(MBEDTLS_SHA512_C)
#define MBEDTLS_SHA512_C
#endif

#if !defined(MBEDTLS_ARC4_C)
#define MBEDTLS_ARC4_C
#endif

#if !defined(MBEDTLS_DES_C)
#define MBEDTLS_DES_C
#endif

#if !defined(MBEDTLS_CMAC_C)
#define MBEDTLS_CMAC_C
#endif

#if !defined(MBEDTLS_CIPHER_MODE_CBC)
#define MBEDTLS_CIPHER_MODE_CBC
#endif

#if !defined(MBEDTLS_CIPHER_MODE_CTR)
#define MBEDTLS_CIPHER_MODE_CTR
#endif

#if !defined(MBEDTLS_GCM_C)
#define MBEDTLS_GCM_C
#endif

#if !defined(MBEDTLS_CCM_C)
#define MBEDTLS_CCM_C
#endif

#if !defined(MBEDTLS_CAMELLIA_C)
#define MBEDTLS_CAMELLIA_C
#endif

#if !defined(MBEDTLS_BLOWFISH_C)
#define MBEDTLS_BLOWFISH_C
#endif

#if !defined(MBEDTLS_CTR_DRBG_C)
#define MBEDTLS_CTR_DRBG_C
#endif

#if !defined(MBEDTLS_HMAC_DRBG_C)
#define MBEDTLS_HMAC_DRBG_C
#endif

#if !defined(MBEDTLS_RSA_C)
#define MBEDTLS_RSA_C
#endif

#if !defined(MBEDTLS_ECDSA_C)
#define MBEDTLS_ECDSA_C
#endif

#if !defined(MBEDTLS_ECDH_C)
#define MBEDTLS_ECDH_C
#endif