nRF5 SDK v15.3.0
micro_ecc backend

The micro_ecc backend provides functionality to use micro_ecc in nrf_crypto.

Note
All APIs in this backend are intended to be internal to nrf_crypto.

Configuration

See Configuring nrf_crypto frontend and backends for details on enabling this backend.

Available frontend API

See Cryptography library - nrf_crypto for information about which nrf_crypto APIs can use this backend.

Installing micro-ecc

The cryptography library expects to find the compiled micro-ecc library in <InstallFolder>\external\micro-ecc\micro-ecc.

To install micro-ecc, complete the following steps:

  1. Install version 4.9-2015-q3-update of the GCC compiler toolchain for ARM. You can use ARM's Launchpad to find the toolchain for your operating system.
  2. Make sure that make is installed (see, for example, MinGW, GNU Make, or Xcode).
  3. Clone the micro-ecc GitHub repository into <InstallFolder>\external\micro-ecc\micro-ecc.
  4. Enter the subdirectory for the SoC and the toolchain that you are using to build your application:
    • InstallFolder\external\micro-ecc\nrf52_keil\armgcc
    • InstallFolder\external\micro-ecc\nrf52_iar\armgcc
    • InstallFolder\external\micro-ecc\nrf52_armgcc\armgcc
  5. Run make to compile the micro-ecc library.
Note
If you compile the micro-ecc library without using the provided Makefiles, make sure to use the default compilation options with -Os and optimization level 3. If you change the preprocessor macros (most importantly, uECC_VLI_NATIVE_LITTLE_ENDIAN=1), the library might not work properly.

Enabling micro-ecc support in selected examples

Some of the examples in this SDK use nrf_crypto to demonstrate the LESC functionality. For a list of these examples and the backends they support, refer to the table showing supported nrf_crypto backends. The examples marked with an asterisk in the table can be configured to use micro-ecc, but you must first manually add the micro-ecc library file to the project.

Follow these steps to enable micro-ecc support in these examples.

  1. Enable the micro-ecc backend by setting NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED to 1 in a text editor or through a graphical interface.
    enable_micro_ecc_backend.png
    Enabling micro-ecc backend

  2. Disable the corresponding configuration parameter in other nrf_crypto backends in order to enable micro-ecc.
  3. Add the micro-ecc library file to the project. Make sure to select the correct library appropriate for your architecture and compiler version.
    • SES
      Use the drag-and-drop feature to add the correct library file to any folder in the project file view. The file will be displayed in the project file list.
      add_lib_ses.png
      Adding the library file in SES

    • IAR
      Use the drag-and-drop feature to add the correct library file to any folder in the project file view. The file will be displayed in the project file list.
      add_lib_iar.png
      Adding the library file in IAR

    • Keil
      In the project file view, right-click the Application folder to open a context menu. Select Add existing file to group 'Application'.
      add_existing_lib_keil_1.png
      Context menu in Keil

      In the pop-up window that opens, change the file type to *.lib and select the correct version of the library to add.
      add_existing_lib_keil_2.png
      Selecting the library file in Keil

      Click Add.
    • GCC
      In the project makefile, add a line with a path to the library in the following scheme:
      LIB_FILES += \
      $(SDK_ROOT)/external/micro-ecc/nrf52hf_keil/armgcc/micro_ecc_lib_nrf52.lib

Documentation feedback | Developer Zone | Subscribe | Updated