blob: c500f500490dbfded09acacbd2d4059a99747852 [file] [log] [blame]
David Huc9a45592020-02-17 20:26:10 +08001#######################################
2Trusted Firmware-M Profile Small Design
3#######################################
4
5:Authors: David Hu
6:Organization: Arm Limited
7:Contact: david.hu@arm.com
8
9************
10Introduction
11************
12
13The capabilities and resources may dramatically vary on different IoT devices.
14Some IoT devices may have very limited memory resource. The program on those
15devices should keep small memory footprint and basic functionalities.
16On the other hand, some devices may consist of more memory and extended storage,
17to support stronger software capabilities.
18
19Diverse IoT use cases also require different levels of security and requirements
20on device resource. For example, use cases require different cipher
21capabilities. Selecting cipher suites can be sensitive to memory footprint on
22devices with constrained resource.
23
24Trusted Firmware-M (TF-M) defines 3 general profiles, Profile Small,
25Profile Medium and Profile Large, to provide different levels of security to fit
26diverse device capabilities and use cases.
27Each profile specifies a predefined list of features, targeting typical use
28cases with specific hardware constraints. Profiles can serve as reference
29designs, based on which developers can continue further development and
30configurations, according to use case.
31
32As one of the TF-M Profiles, TF-M Profile Small (Profile S) consists of
33lightweight TF-M framework and basic Secure Services to keep smallest memory
34footprint, supporting fundamental security features on devices with ultra
35constrained resource.
36
37This profile enables connecting with Edge Gateways and IoT Cloud Services
38supporting secure connection based solely on symmetric cryptography.
39
40This document summarizes and discusses the features specified in TF-M Profile
41Small.
42
43**************
44Overall design
45**************
46
47TF-M Profile Small defines the following features:
48
49 - Lightweight framework
50
51 - Library model
52 - Level 1 isolation
53 - Buffer sharing allowed
54 - Single secure context
55
56 - Crypto
57
58 - Symmetric cipher only
59 - Cipher suite for symmetric-key algorithms based protocols, such as
60 cipher suites defined in TLS pre-shared key (TLS-PSK) [1]_.
61
62 - Advanced Encryption Standard (AES) as symmetric crypto algorithm
63 - SHA256 as Hash function
64 - HMAC as Message Authentication Code algorithm
65
66 - Internal Trusted Storage (ITS)
67
68 - No encryption
69 - No rollback protection
70 - Decrease internal transient buffer size
71
72 - Initial Attestation
73
74 - Based on symmetric key algorithms
75
76 - Lightweight boot
77
78 - Single image boot
79 - Anti-rollback protection is enabled
80
81
82Protected Storage, audit logging and other Secure Services provided by TF-M are
83disabled by default.
84
85**************
86Design details
87**************
88
89More details of TF-M Profile Small design are discussed in following sections.
90
91Lightweight framework
92=====================
93
94Library model
95-------------
96
97Profile Small selects Library model in TF-M. Library model implements secure
98function calls, via which clients directly call secure services. It provides a
99more simple implementation of TF-M framework and may reduce memory footprint,
100compared with Inter-Process Communication (IPC) model [2]_.
101
102.. note ::
103
104 **Implementation note**
105
106 Please note that there is no public dedicated specification for Library
107 model.
108 The design, interfaces and implementation of Library model in TF-M may
109 change.
110
111Level 1 isolation
112-----------------
113
114So far, TF-M Library model only supports level 1 isolation [2]_, which isolates
115Secure Processing Environment (SPE) from Non-secure Processing Environment
116(NSPE). Neither level 2 nor level 3 isolation [2]_ is implemented in TF-M
117Library model.
118
119PSA Root of Trust (PSA RoT) and Application Root of Trust (ARoT) are isolated
120from each other in level 2 isolation.
121Individual secure partitions are isolated from each other even within a
122particular security domain (PSA RoT, ARoT), in level 3 isolation.
123
124Profile Small dedicated use cases with simple service model may not require
125level 2 or level 3 isolation. Devices which Profile Small aims at may be unable
126to implement stricter isolation, limited by hardware capabilities.
127
128Level 1 isolation reduces requirements enforced by hardware isolation and cost
129of software for management.
130
131.. note ::
132
133 **Security note**
134
135 If a device or a use case enforces level 2 or level 3 isolation, it is
136 suggested to apply other configurations, other than TF-M Profile Small.
137
138Buffer sharing allowed
139----------------------
140
141To simplify interface and reduce memory footprint, TF-M Library model directly
142handles client call input vectors from non-secure client buffers and later
143writes results back to those buffers, without keeping a copy in a transient
144buffer inside TF-M.
145
146.. note ::
147
148 **Security note**
149
150 There can be security vulnerabilities if non-secure client buffers are
151 directly shared between NSPE and SPE, such as Time-of-check to time-of-use
152 (TOCTOU) attack.
153
154 Developers need to check if this can meet the Security Functional
155 Requirements (SFR) of the integration of their devices.
156 Some SFRs are listed in a set of example Threat Models and Security Analyses
157 (TMSA) offered by PSA for common IoT use cases. [3]_
158
159Single secure context
160---------------------
161
162TF-M Library model only supports single secure context.
163
164It cannot support multiple contexts or the scheduling implemented in IPC model.
165It neither can support multiple outstanding PSA client calls.
166
167But correspondingly, it can save memory footprint and runtime complexity in
168context management and scheduling.
169
170.. note ::
171
172 **Security note**
173
174 Non-secure software should prevent triggering multiple outstanding PSA
175 client calls concurrently. Otherwise, it may crash current running secure
176 context.
177
178Crypto service
179==============
180
181TF-M Profile Small only requires symmetric crypto since symmetric algorithms
182require shorter keys and less computational burden, compared with asymmetric
183crypto.
184
185By default, TF-M Profile Small requires the same capabilities as defined in
186TLS-PSK, to support symmetric key algorithms based protocols.
187
188.. note ::
189
190 **Implementation note**
191
192 Please note that TF-M Profile Small doesn't require that TLS-PSK is
193 mandatory in applications. Instead, Profile Small only requires the same
194 capabilities as defined in TLS-PSK, such as one symmetric cipher algorithm
195 and one hash function.
196
197TF-M Profile Small selects TLS-PSK cipher suite TLS_PSK_WITH_AES_128_CCM [4]_
198as reference, which requires:
199
200 - AES-128-CCM (AES CCM mode with 128-bit key) as symmetric crypto algorithm
201 - SHA256 as Hash function
202 - HMAC as Message Authentication Code algorithm
203
204TLS_PSK_WITH_AES_128_CCM is selected since it requires small key length and less
205hardware capabilities, while keeping enough level of security.
206
207.. note ::
208
209 **Implementation note**
210
211 Developers can replace default algorithms with others or implement more
212 algorithms.
213
214 Proper symmetric key algorithms and cipher suites should be selected
215 according to device capabilities, the use case and the requirement of peers
216 in connection.
217
218 Refer to `Crypto service configuration`_ for implementation details of
219 configuring algorithms and cipher suites.
220
221.. note ::
222
223 **Security note**
224
225 It is recommended not to use MD5 or SHA-1 for message digests as they are
226 subject to collision attacks [5]_ [6]_.
227
228Secure Storage
229==============
230
231TF-M Profile Small assumes that extremely constrained devices only contain basic
232on-chip storage, without external or removable storage.
233As a result, TF-M Profile Small includes ITS service and disables Protected
234Storage service.
235
236Encryption and rollback protection
237----------------------------------
238
239Neither encryption nor rollback protection is enabled in current ITS
240implementation.
241
242It is expected that ITS relies solely on the physical inaccessibility property
243of on-chip storage, together with PSA isolation, without requiring additional
244cryptographic protection.
245
246Internal transient buffer
247-------------------------
248
249ITS implements a internal transient buffer [7]_ to hold the data read
250from/written to storage, especially for flash, to solve the alignment and
251security issues.
252
253The internal transient buffer is aligned to the flash device’s program unit.
254Copying data to it from the caller can align all write requests to the flash
255device’s program unit.
256The internal transient buffer can help protect Flash access from some attacks,
257such as TOCTOU attack.
258
259Although removing this internal buffer can save some memory consumption,
260typically 512 bytes, it may bring alignment or security issues.
261Therefore, to achieve a better trade-off between memory footprint and security,
262TF-M Profile Small optimizes the internal buffer size to 32 bytes by default.
263
264As discussed in `Crypto service`_, TF-M Profile Small requires AES-128 and
265SHA-256, which use 128-bit key and 256-bit key respectively.
266Besides, either long public/private keys or PKI-based certificates should be
267very rare as asymmetric crypto is not supported in Profile Small.
268Therefore, a 32-byte internal buffer should cover the assets in TF-M Profile
269Small use cases.
270
271The buffer size can be adjusted according to use case and device Flash
272attributes. Refer to `Internal Trusted Storage configurations`_ for more
273details.
274
275Initial Attestation
276===================
277
278Profile Small requires an Initial Attestation secure service based on symmetric
279key algorithms. Refer to PSA Attestation API document [8]_ for details of
280Initial Attestation based on symmetric key algorithms.
281
282It can heavily increase memory footprint to support Initial Attestation based on
283asymmetric key algorithms, due to asymmetric ciphers and related PKI modules.
284
285.. note ::
286
287 **Implementation note**
288
289 As pointed out by PSA Attestation API document [8]_, the use cases of
290 Initial Attestation based on symmetric key algorithms can be limited due to
291 the associated infrastructure costs for key management and operational
292 complexities. It may also restrict the ability to interoperate with
293 scenarios that involve third parties.
294
295 If asymmetric key algorithms based Initial Attestation is required in use
296 scenarios, it is recommended to select other TF-M Profiles which support
297 asymmetric key algorithms.
298
299.. note ::
300
301 **Implementation note**
302
303 It is recommended to utilize the same MAC algorithm supported in Crypto
304 service to complete the signing in ``COSE_Mac0``, to minimize memory
305 footprint.
306
307Lightweight boot
308================
309
310If MCUBoot provided by TF-M is enabled, single image boot [9]_ is selected by
311default in Profile Small.
312In case of single image boot, secure and non-secure images are handled as a
313single blob and signed together during image generation.
314
315However, secure and non-secure images must be updated together in single image
316boot. It may decrease the flexibility of image update and cost longer update
317process. Since the image sizes should usually be small with limited
318functionalities in Profile Small dedicated use case, the cost may still be
319reasonable.
320
321BL2 implementation can be device specific. Devices may implement diverse
322boot processes with different features and configurations.
323However, anti-rollback protection is required as a mandatory feature of boot
324loader. Boot loader should be able to prevent unauthorized rollback, to protect
325devices from being downgraded to earlier versions with known vulnerabilities.
326
327**************
328Implementation
329**************
330
331Overview
332========
333
Anton Komlevb8e3af02020-08-28 10:23:57 +0100334The basic idea is to add dedicated profile CMake configuration files under
335folder ``config/profile`` for TF-M Profile Small default configuration.
David Huc9a45592020-02-17 20:26:10 +0800336
Anton Komlevb8e3af02020-08-28 10:23:57 +0100337The top-level Profile Small config file collects all the necessary
338configuration flags and set them to default values, to explicitly enable the
339features required in Profile Small and disable the unnecessary ones, during
340TF-M build.
David Huc9a45592020-02-17 20:26:10 +0800341
342A platform/use case can provide a configuration extension file to overwrite
343Profile Small default setting and append other configurations.
344This configuration extension file can be added via parameter
Anton Komlevb8e3af02020-08-28 10:23:57 +0100345``TFM_EXTRA_CONFIG_PATH`` in build command line.
David Huc9a45592020-02-17 20:26:10 +0800346
Anton Komlevb8e3af02020-08-28 10:23:57 +0100347The behaviour of the Profile Small build flow (particularly the order of
348configuration loading and overriding) can be found at
349:ref:`tfm_cmake_configuration`
David Huc9a45592020-02-17 20:26:10 +0800350
Anton Komlevb8e3af02020-08-28 10:23:57 +0100351The details of configurations will be covered in each module in
352`Implementation details`_.
David Huc9a45592020-02-17 20:26:10 +0800353
354Implementation details
355======================
356
357This section discusses the details of Profile Small implementation.
358
Anton Komlevb8e3af02020-08-28 10:23:57 +0100359Top-level configuration files
360-----------------------------
361
362The firmware framework configurations in ``config/profile/profile_small`` are
363shown below.
364
365.. table:: TFM options in Profile Small top-level CMake config file
366 :widths: auto
367 :align: center
368
369 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
370 | Configs | Default value | Descriptions |
371 +============================================+=====================================================================================================+=====================================+
372 | ``TFM_ISOLATION_LEVEL`` | ``1`` | Select level 2 isolation |
373 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
374 | ``TFM_PSA_API`` | ``FALSE`` | Select IPC model |
375 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
376 | ``TFM_PARTITION_INTERNAL_TRUSTED_STORAGE`` | ``ON`` | Enable ITS SP |
377 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
378 | ``ITS_BUF_SIZE`` | ``32`` | ITS internal transient buffer size |
379 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
380 | ``TFM_PARTITION_CRYPTO`` | ``ON`` | Enable Crypto service |
381 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
382 | ``TFM_MBEDCRYPTO_CONFIG_PATH`` | ``${CMAKE_SOURCE_DIR}/lib/ext/mbedcrypto/mbedcrypto_config/tfm_mbedcrypto_config_profile_small.h`` | Mbed Crypto config file path |
383 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
384 | ``CRYPTO_ASYMMETRIC_MODULE_DISABLED`` | ``ON`` | Disable asymmetric crypto |
385 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
386 | ``TFM_PARTITION_INITIAL_ATTESTATION`` | ``ON`` | Enable Initial Attestation service |
387 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
388 | ``SYMMETRIC_INITIAL_ATTESTATION`` | ``ON`` | Enable symmetric attestation |
389 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
390 | ``TFM_PARTITION_PROTECTED_STORAGE`` | ``OFF`` | Enable PS service |
391 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
392 | ``TFM_PARTITION_PLATFORM`` | ``OFF`` | Enable TF-M Platform SP |
393 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
394 | ``TFM_PARTITION_AUDIT_LOG`` | ``OFF`` | Disable TF-M audit logging service |
395 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
396
David Huc9a45592020-02-17 20:26:10 +0800397.. note ::
398
399 **Implementation note**
400
401 The following sections focus on the feature selection via configuration
402 setting.
403 Dedicated optimization on memory footprint is not covered in this document.
404
Anton Komlevb8e3af02020-08-28 10:23:57 +0100405Test configuration
406^^^^^^^^^^^^^^^^^^
David Huc9a45592020-02-17 20:26:10 +0800407
Anton Komlevb8e3af02020-08-28 10:23:57 +0100408Standard regression test configuration applies. This means that enabling
409regression testing via
David Huc9a45592020-02-17 20:26:10 +0800410
Anton Komlevb8e3af02020-08-28 10:23:57 +0100411``-DTEST_S=ON -DTEST_NS=ON``
David Huc9a45592020-02-17 20:26:10 +0800412
Anton Komlevb8e3af02020-08-28 10:23:57 +0100413Will enable testing for all enabled partitions. See above for details of enabled
414partitions. Because Profile Small does not enable IPC mode, the IPC tests are
415not enabled.
416
417Some cryptography tests are disabled due to the reduced Mbed Crypto config.
418
419.. table:: TFM options in Profile Small top-level CMake config file
420 :widths: auto
421 :align: center
422
423 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
424 | Configs | Default value | Descriptions |
425 +============================================+=====================================================================================================+=====================================+
426 | ``TFM_CRYPTO_TEST_ALG_CBC`` | ``OFF`` | Test CBC cryptography mode |
427 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
428 | ``TFM_CRYPTO_TEST_ALG_CCM`` | ``ON`` | Test CCM cryptography mode |
429 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
430 | ``TFM_CRYPTO_TEST_ALG_CFB`` | ``OFF`` | Test CFB cryptography mode |
431 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
432 | ``TFM_CRYPTO_TEST_ALG_CTR`` | ``OFF`` | Test CTR cryptography mode |
433 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
434 | ``TFM_CRYPTO_TEST_ALG_GCM`` | ``OFF`` | Test GCM cryptography mode |
435 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
436 | ``TFM_CRYPTO_TEST_ALG_SHA_512`` | ``OFF`` | Test SHA-512 cryptography algorithm |
437 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
438 | ``TFM_CRYPTO_TEST_HKDF`` | ``OFF`` | Test SHA-512 cryptography algorithm |
439 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
David Huc9a45592020-02-17 20:26:10 +0800440
441Device configuration extension
442^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
443
Anton Komlevb8e3af02020-08-28 10:23:57 +0100444To change default configurations and add platform specific configurations,
445a platform can add a platform configuration file at
446``platform/ext<TFM_PLATFORM>/config.cmake``
David Huc9a45592020-02-17 20:26:10 +0800447
448TF-M framework setting
449----------------------
450
451The top-level Profile Small CMake config file selects Library model and level 1
452isolation.
453
454Crypto service configuration
455----------------------------
456
457Crypto Secure Partition
458^^^^^^^^^^^^^^^^^^^^^^^
459
460TF-M Profile Small enables Crypto Secure Partition (SP) in its top-level CMake
461config file. Crypto SP modules not supported in TF-M Profile Small are disabled.
462The disabled modules are shown below.
463
464 - Disable asymmetric cipher
David Huc9a45592020-02-17 20:26:10 +0800465
466Other modules and configurations [10]_ are kept as default values.
467
468Additional configuration flags with more fine granularity can be added to
469control building of specific crypto algorithms and corresponding test cases.
470
471Mbed Crypto configurations
472^^^^^^^^^^^^^^^^^^^^^^^^^^
473
474TF-M Profile Small adds a dedicated Mbed Crypto config file
Anton Komlevb8e3af02020-08-28 10:23:57 +0100475``tfm_mbedcrypto_config_profile_small.h`` at
476``/lib/ext/mbedcrypto/mbedcrypto_config``
477file, instead of the common one ``tfm_mbedcrypto_config_default.h`` [10]_.
David Huc9a45592020-02-17 20:26:10 +0800478
479Major Mbed Crypto configurations are set as listed below:
480
481 - Enable SHA256
482 - Enable generic message digest wrappers
483 - Enable AES
484 - Enable CCM mode for symmetric ciphers
485 - Disable other modes for symmetric ciphers
486 - Disable asymmetric ciphers
487 - Disable HMAC-based key derivation function (HKDF)
488
489Other configurations can be selected to optimize the memory footprint of Crypto
490module.
491
Anton Komlevb8e3af02020-08-28 10:23:57 +0100492A device/use case can append an extra config header to the Profile Small
493default Mbed Crypto config file. This can be done by setting the
494``TFM_MBEDCRYPTO_PLATFORM_EXTRA_CONFIG_PATH`` cmake variable in the platform
495config file ``platform/ext<TFM_PLATFORM>/config.cmake``. This cmake variable is
496a wrapper around the ``MBEDTLS_USER_CONFIG_FILE`` options, but is preferred as
497it keeps all configuration in cmake.
David Huc9a45592020-02-17 20:26:10 +0800498
499Internal Trusted Storage configurations
500---------------------------------------
501
502ITS service is enabled in top-level Profile Small CMake config file.
503
504The internal transient buffer size ``ITS_BUF_SIZE`` [7]_ is set to 32 bytes by
505default. A platform/use case can overwrite the buffer size in its specific
506configuration extension according to its actual requirement of assets and Flash
507attributes.
508
509Profile Small CMake config file won't touch the configurations of device
510specific Flash hardware attributes [7]_.
511
512Initial Attestation secure service
513----------------------------------
514
515TF-M Profile Small provides a reference implementation of symmetric key
516algorithms based Initial Attestation, using HMAC SHA-256 as MAC algorithm in
517``COSE_Mac0`` structure. The implementation follows PSA Attestation API document
518[8]_.
519
520Profile Small top-level config file enables Initial Attestation secure service
521and selects symmetric key algorithms based Initial Attestation by default.
522
523 - Set ``TFM_PARTITION_INITIAL_ATTESTATION`` to ``ON``
524 - Set ``SYMMETRIC_INITIAL_ATTESTATION`` to ``ON``
525
526Symmetric and asymmetric key algorithms based Initial Attestation can share the
527same generations of token claims, except Instance ID claim.
528
529Profile Small may implement the procedure or rely on a 3rd-party tool to
530construct and sign ``COSE_Mac0`` structure.
531
532Details of symmetric key algorithms based Initial Attestation design will be
533covered in a dedicated document.
534
535Disabled secure services
536------------------------
537
538Audit logging, Protected Storage, and Platform Service are disabled by default
539in Profile Small top-level CMake config file.
540
541BL2 setting
542-----------
543
544Profile Small enables MCUBoot provided by TF-M by default. A platform can
545overwrite this configuration by disabling MCUBoot in its configuration extension
Anton Komlevb8e3af02020-08-28 10:23:57 +0100546file ``platform/ext<TFM_PLATFORM>/config.cmake``.
David Huc9a45592020-02-17 20:26:10 +0800547
548If MCUBoot provided by TF-M is enabled, single image boot is selected in TF-M
549Profile Small top-level CMake config file.
550
David Huc9a45592020-02-17 20:26:10 +0800551If a device implements its own boot loader, the configurations are
552implementation defined.
553
Anton Komlevb8e3af02020-08-28 10:23:57 +0100554.. table:: BL2 options in Profile Small top-level CMake config file
555 :widths: auto
556 :align: center
557
558 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
559 | Configs | Default value | Descriptions |
560 +============================================+=====================================================================================================+=====================================+
561 | ``BL2`` | ``ON`` | Enable MCUBoot bootloader |
562 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
563 | ``MCUBOOT_IMAGE_NUMBER`` | ``1`` | Combine S and NS images |
564 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
565
David Huc9a45592020-02-17 20:26:10 +0800566****************
567Platform support
568****************
569
David Huc9a45592020-02-17 20:26:10 +0800570Building Profile Small
571======================
572
Anton Komlevb8e3af02020-08-28 10:23:57 +0100573To build Profile Small, argument ``TFM_PROFILE`` in build command line should be
574set to ``profile_small``.
David Huc9a45592020-02-17 20:26:10 +0800575
576Take AN521 as an example.
577
578The following commands build Profile Small without test cases on **AN521** with
579build type **MinSizeRel**, built by **Armclang**.
580
581.. code-block:: bash
582
Anton Komlevb8e3af02020-08-28 10:23:57 +0100583 cd <TFM root dir>
584 mkdir build && cd build
585 cmake -DTFM_PLATFORM=mps2/an521 \
586 -DCMAKE_TOOLCHAIN_FILE=../toolchain_ARMCLANG.cmake \
587 -DTFM_PROFILE=profile_small \
588 -DCMAKE_BUILD_TYPE=MinSizeRel \
589 ../
590 cmake --build ./ -- install
David Huc9a45592020-02-17 20:26:10 +0800591
592The following commands build Profile Small with regression test cases on **AN521**
593with build type **MinSizeRel**, built by **Armclang**.
594
595.. code-block:: bash
596
Anton Komlevb8e3af02020-08-28 10:23:57 +0100597 cd <TFM root dir>
598 mkdir build && cd build
599 cmake -DTFM_PLATFORM=mps2/an521 \
600 -DCMAKE_TOOLCHAIN_FILE=../toolchain_ARMCLANG.cmake \
601 -DTFM_PROFILE=profile_small \
602 -DCMAKE_BUILD_TYPE=MinSizeRel \
603 -DTEST_S=ON -DTEST_NS=ON \
604 ../
605 cmake --build ./ -- install
606
607.. Note::
608
609 - For devices with more contrained memory and flash requirements, it is
610 possible to build with either only TEST_S enabled or only TEST_NS enabled.
611 This will decrease the size of the test images. Note that both test suites
612 must still be run to ensure correct operation.
David Huc9a45592020-02-17 20:26:10 +0800613
614More details of building instructions and parameters can be found TF-M build
615instruction guide [11]_.
616
David Huc9a45592020-02-17 20:26:10 +0800617*********
618Reference
619*********
620
621.. [1] `Pre-Shared Key Ciphersuites for Transport Layer Security (TLS) <https://tools.ietf.org/html/rfc4279>`_
622
623.. [2] `DEN0063 Arm Platform Security Architecture Firmware Framework 1.0 <https://developer.arm.com/-/media/Files/pdf/DeviceSecurityArchitecture/Architect/DEN0063-PSA_Firmware_Framework-1.0.0-2.pdf?revision=2d1429fa-4b5b-461a-a60e-4ef3d8f7f4b4>`_
624
625.. [3] `PSA analyze stage <https://developer.arm.com/architectures/security-architectures/platform-security-architecture#analyze>`_
626
627.. [4] `AES-CCM Cipher Suites for Transport Layer Security (TLS) <https://tools.ietf.org/html/rfc6655>`_
628
629.. [5] `Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms <https://tools.ietf.org/html/rfc6151>`_
630
631.. [6] `Transitioning the Use of Cryptographic Algorithms and Key Lengths <https://www.nist.gov/publications/transitioning-use-cryptographic-algorithms-and-key-lengths>`_
632
Minos Galanakise4094012020-06-12 14:25:34 +0100633.. [7] :doc:`ITS integration guide </docs/reference/services/tfm_its_integration_guide>`
David Huc9a45592020-02-17 20:26:10 +0800634
635.. [8] `PSA Attestation API 1.0 (ARM IHI 0085) <https://developer.arm.com/-/media/Files/pdf/PlatformSecurityArchitecture/Implement/IHI0085-PSA_Attestation_API-1.0.2.pdf?revision=eef78753-c77e-4b24-bcf0-65596213b4c1&la=en&hash=E5E0353D612077AFDCE3F2F3708A50C77A74B2A3>`_
636
Minos Galanakise4094012020-06-12 14:25:34 +0100637.. [9] :doc:`Secure boot </docs/getting_started/tfm_secure_boot>`
David Huc9a45592020-02-17 20:26:10 +0800638
639.. [10] :doc:`Crypto design </docs/design_documents/tfm_crypto_design>`
640
Minos Galanakise4094012020-06-12 14:25:34 +0100641.. [11] :doc:`TF-M build instruction </docs/getting_started/tfm_build_instruction>`
David Huc9a45592020-02-17 20:26:10 +0800642
643--------------
644
645*Copyright (c) 2020, Arm Limited. All rights reserved.*