|
| 1 | +.. _doc_bl_crypto: |
| 2 | + |
| 3 | +Bootloader crypto |
| 4 | +################# |
| 5 | + |
| 6 | +The bootloader crypto library is the cryptography library that is used by the :ref:`bootloader`. |
| 7 | + |
| 8 | +The API is public because applications that are booted by the immutable bootloader can call functions from this library via the bootloader's code, through external APIs. |
| 9 | +See :ref:`doc_fw_info_ext_api` for more information. |
| 10 | + |
| 11 | +The library provides the following functionality: |
| 12 | + |
| 13 | +* SHA256 hashing |
| 14 | +* SECP256R1 signature validation |
| 15 | +* Root-of-trust firmware validation, which is the function the bootloader uses to validate a firmware's signature and digest, using the SHA256 and SECP256R1 algorithms |
| 16 | + |
| 17 | +These functions are available as separate external APIs. |
| 18 | +The API can be used the same way regardless of which backend is used. |
| 19 | + |
| 20 | +Backends |
| 21 | +******** |
| 22 | + |
| 23 | +When using the library, you can choose between the following backends: |
| 24 | + |
| 25 | +* Hardware backend :ref:`nrf_cc310_bl_readme` (can only be used if Arm CryptoCell CC310 is available) |
| 26 | +* Software backend :ref:`nrf_oberon_readme` |
| 27 | +* Another image's instance of the bootloader crypto library, called via external APIs. |
| 28 | + The other image chooses its own backend. |
| 29 | + |
| 30 | +To configure which backend is used for hashing, set one of the following configuration options: |
| 31 | + |
| 32 | +* :option:`CONFIG_SB_CRYPTO_OBERON_SHA256` |
| 33 | +* :option:`CONFIG_SB_CRYPTO_CC310_SHA256` |
| 34 | +* :option:`CONFIG_SB_CRYPTO_CLIENT_SHA256` |
| 35 | + |
| 36 | +To configure which backend is used for firmware verification, set one of the following configuration options: |
| 37 | + |
| 38 | +* :option:`CONFIG_SB_CRYPTO_CC310_ECDSA_SECP256R1` |
| 39 | +* :option:`CONFIG_SB_CRYPTO_OBERON_ECDSA_SECP256R1` |
| 40 | +* :option:`CONFIG_SB_CRYPTO_CLIENT_ECDSA_SECP256R1` |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +API documentation |
| 45 | +***************** |
| 46 | + |
| 47 | +| Header file: :file:`include/bl_crypto.h` |
| 48 | +| Source files: :file:`subsys/bootloader/bl_crypto/` and :file:`subsys/bootloader/bl_crypto_client/` |
| 49 | +
|
| 50 | +.. doxygengroup:: bl_crypto |
| 51 | + :project: nrf |
| 52 | + :members: |
0 commit comments