You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -46,11 +46,11 @@ It is possible to provide your own custom mbed TLS configuration file by deselec
46
46
But if doing so, please read `User provided mbed TLS config header`_.
47
47
48
48
49
-
Enabling backends
50
-
=================
49
+
nrf_security backends
50
+
=====================
51
51
52
52
The nrf_security module supports multiple enabled backends at the same time.
53
-
This is done to extend the feature set of hardware accelerated cryptography in case it is limited.
53
+
This mechanism is intended to extend the available feature set of hardware accelerated cryptography.
54
54
Enabling one or more backends adds more configuration options grouped into classes of cryptographic algorithms.
55
55
56
56
Note that configuration options added after enabling one or more backends will change based on the number of enabled backends.
@@ -61,13 +61,35 @@ The nrf_security module supports two backends:
61
61
* Arm CryptoCell CC310 (in nRF52840 and nRF9160)
62
62
* Standard mbed TLS
63
63
64
+
65
+
Arm CryptoCell CC310 backend
66
+
----------------------------
67
+
68
+
The Arm CryptoCell CC310 backend is a library which provides hardware accelerated cryptography using the CC310 hardware.
69
+
70
+
The Arm CryptoCell CC310 backend is only available on the following devices:
71
+
72
+
* nRF52840
73
+
* nRF9160
74
+
75
+
64
76
Enabling the Arm CryptoCell CC310 backend
65
77
-----------------------------------------
66
78
67
79
To enable the Arm CryptoCell CC310 backend, set the :option:`CONFIG_CC310_BACKEND` Kconfig variable to true.
68
80
69
81
.. note:: This backend is only available in nRF52840 and nRF9160.
70
82
83
+
84
+
Standard mbed TLS backend
85
+
-------------------------
86
+
87
+
The standard `mbed TLS backend <https://tls.mbed.org/>`_ is a software-only library provided by Arm.
88
+
89
+
The standard mbed TLS backend can be used on nRF devices that do not feature the CC310 hardware.
90
+
Alternatively, it can be used on CC310 enabled devices to add support for features not available in the `Arm CryptoCell CC310 backend`_, for example AES-256 or ECC Brainpool curves.
91
+
92
+
71
93
Enabling the standard mbed TLS backend
72
94
--------------------------------------
73
95
@@ -77,24 +99,10 @@ To enable the standard mbed TLS backend, set the :option:`CONFIG_MBEDTLS_VANILLA
77
99
Using the nrf_cc310_mbedcrypto as backend
78
100
-----------------------------------------
79
101
80
-
To use the :ref:`nrf_cc310_mbedcrypto_readme` as a backend, it must be initialized using the standard mbed TLS APIs for platform abstraction:
102
+
To use the :ref:`nrf_cc310_mbedcrypto_readme` as a backend, the CC310 hardware must first be initialized.
81
103
82
-
.. code-block:: c
83
-
:caption: Initializing the nrf_cc310_mbedcrypto backend
The :option:`CONFIG_MBEDTLS_SHA256_SMALLER` Kconfig variable can be used to select a SHA-256 implementation with smaller footprint.
727
+
Such configuration reduces SHA-256 calculation performance.
728
+
729
+
For example, on a Cortex-M4, the size of :cpp:func:`mbedtls_sha256_process()` is reduced from ~2 KB to ~0.5 KB, however it also performs around 30% slower.
The :option:`CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN` Kconfig variable can be used to specify the maximum size for incoming and outgoing mbed TLS I/O buffers.
742
+
The default value is 16384 as specified in RFC5246, however if both sides are under your control, this value can safely be reduced under the following conditions:
743
+
744
+
* Both sides support the max_fragment_length SSL extension, RFC8449.
745
+
The max_fragment_length allows for buffer reduction to less than 1 KB.
746
+
* Knowledge of the maximum size that will ever be sent in a single SSL/TLS frame.
747
+
748
+
If one of those conditions is met, the buffer size can safely be reduced to a more appropriate value for memory constrained devices.
749
+
750
+
The :option:`CONFIG_MBEDTLS_SSL_CIPHERSUITES` Kconfig variable is a custom list of cipher suites to support in SSL/TLS.
751
+
The cipher suites are provided as a comma-separated string, in order of preference.
752
+
This list can only be used for restricting cipher suites available in the system.
The string in :option:`CONFIG_MBEDTLS_SSL_CIPHERSUITES` should not be quoted.
679
765
680
766
681
-
Userprovided mbed TLS config header
767
+
User-provided mbed TLS config header
682
768
------------------------------------
683
769
684
-
The :ref:`nrf_security_readme` provides a Kconfig interface to control
685
-
compilation and linking of mbed TLS and the :ref:`nrf_cc310_mbedcrypto_readme`
686
-
library.
770
+
The :ref:`nrf_security_readme` provides a Kconfig interface to control compilation and linking of mbed TLS and the :ref:`nrf_cc310_mbedcrypto_readme` library.
687
771
688
-
The Kconfig interface and build system ensures that the configuration of
689
-
:ref:`nrf_security_readme` is valid and working, and ensures that depencies
690
-
between different cryptographic APIs are met.
772
+
The Kconfig interface and build system ensures that the configuration of :ref:`nrf_security_readme` is valid and working, and ensures that dependencies between different cryptographic APIs are met.
691
773
692
-
It is therefore highly recommended to let the build system generate the mbed TLS
693
-
configuration header.
774
+
It is therefore highly recommended to let the build system generate the mbed TLS configuration header.
694
775
695
-
However, for special use-case that can not be achieved using the Kconfig
696
-
configuration tool, it is possible to provide a custom mbed TLS configuration
697
-
header. When doing so, care must be taken to ensure a working system.
776
+
However, for special use cases that cannot be achieved using the Kconfig configuration tool, it is possible to provide a custom mbed TLS configuration header.
777
+
When doing so, make sure that the system is working.
698
778
699
-
It it therefore advised to use Kconfig and the build system to create a mbed TLS
700
-
configuration header as a starting point, and then tweak this file to include
701
-
settings not available i Kconfig.
779
+
It is therefore advised to use Kconfig and the build system to create an mbed TLS configuration header as a starting point, and then tweak this file to include settings that are not available in Kconfig.
702
780
703
781
.. note::
704
-
When providing a custom mbed TLS configuration header, it is important that
705
-
the following criterea is still met:
782
+
When providing a custom mbed TLS configuration header, it is important that the following criteria are still met:
706
783
707
784
* Entropy length of 144, i.e. ``#define MBEDTLS_ENTROPY_MAX_GATHER 144``
0 commit comments