Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| 3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 4 | |
| 5 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 6 | <head> |
| 7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 8 | <title>2. Design goals — PSA Crypto API 1.0.1 documentation</title> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 9 | <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" /> |
| 10 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
| 11 | <script type="text/javascript"> |
| 12 | var DOCUMENTATION_OPTIONS = { |
| 13 | URL_ROOT: '../', |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 14 | VERSION: '1.0.1', |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 15 | COLLAPSE_INDEX: false, |
| 16 | FILE_SUFFIX: '.html', |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 17 | HAS_SOURCE: false, |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 18 | SOURCELINK_SUFFIX: '.txt' |
| 19 | }; |
| 20 | </script> |
| 21 | <script type="text/javascript" src="../_static/jquery.js"></script> |
| 22 | <script type="text/javascript" src="../_static/underscore.js"></script> |
| 23 | <script type="text/javascript" src="../_static/doctools.js"></script> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 24 | <link rel="author" title="About these documents" href="../about.html" /> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 25 | <link rel="index" title="Index" href="../genindex.html" /> |
| 26 | <link rel="search" title="Search" href="../search.html" /> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 27 | <link rel="next" title="3. Functionality overview" href="functionality.html" /> |
| 28 | <link rel="prev" title="1. Introduction" href="intro.html" /> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 29 | |
| 30 | <link rel="stylesheet" href="../_static/custom.css" type="text/css" /> |
| 31 | |
| 32 | <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" /> |
| 33 | |
| 34 | </head> |
| 35 | <body> |
| 36 | |
| 37 | |
| 38 | <div class="document"> |
| 39 | <div class="documentwrapper"> |
| 40 | <div class="bodywrapper"> |
| 41 | <div class="body" role="main"> |
| 42 | |
| 43 | <div class="section" id="design-goals"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 44 | <span id="id1"></span><h1>2. Design goals</h1> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 45 | <div class="section" id="suitable-for-constrained-devices"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 46 | <h2>2.1. Suitable for constrained devices</h2> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 47 | <p>The interface is suitable for a vast range of devices: from special-purpose |
| 48 | cryptographic processors that process data with a built-in key, to constrained |
| 49 | devices running custom application code, such as microcontrollers, and |
| 50 | multi-application devices, such as servers. Consequentially, the interface is |
| 51 | scalable and modular.</p> |
| 52 | <ul class="simple"> |
| 53 | <li><em>Scalable</em>: devices only need to implement the functionality that they will |
| 54 | use.</li> |
| 55 | <li><em>Modular</em>: larger devices implement larger subsets of the same interface, |
| 56 | rather than different interfaces.</li> |
| 57 | </ul> |
| 58 | <p>In this interface, all operations on unbounded amounts of data |
| 59 | allow <em>multi-part</em> processing, as long as the calculations on the data are |
| 60 | performed in a streaming manner. This means that the application does not need |
| 61 | to store the whole message in memory at one time. As a result, this |
| 62 | specification is suitable for very constrained devices, including those where |
| 63 | memory is very limited.</p> |
| 64 | <p>Memory outside the keystore boundary is managed by the application. An |
| 65 | implementation of the interface is not required to retain any state between |
| 66 | function calls, apart from the content of the keystore and other data that must |
| 67 | be kept inside the keystore security boundary.</p> |
| 68 | <p>The interface does not expose the representation of keys and intermediate data, |
| 69 | except when required for interchange. This allows each implementation to choose |
| 70 | optimal data representations. Implementations with multiple components are also |
| 71 | free to choose which memory area to use for internal data.</p> |
| 72 | </div> |
| 73 | <div class="section" id="a-keystore-interface"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 74 | <h2>2.2. A keystore interface</h2> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 75 | <p>The specification allows cryptographic operations to be performed on a key to |
| 76 | which the application does not have direct access. Except where required for |
| 77 | interchange, applications access all keys indirectly, by an identifier. The key |
| 78 | material corresponding to that identifier can reside inside a security boundary |
| 79 | that prevents it from being extracted, except as permitted by a policy that is |
| 80 | defined when the key is created.</p> |
| 81 | </div> |
| 82 | <div class="section" id="optional-isolation"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 83 | <span id="isolation"></span><h2>2.3. Optional isolation</h2> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 84 | <p>Implementations can isolate the cryptoprocessor from the calling application, |
| 85 | and can further isolate multiple calling applications. The interface allows the |
| 86 | implementation to be separated between a frontend and a backend. In an isolated |
| 87 | implementation, the frontend is the part of the implementation that is located |
| 88 | in the same isolation boundary as the application, which the application |
| 89 | accesses by function calls. The backend is the part of the implementation that |
| 90 | is located in a different environment, which is protected from the frontend. |
| 91 | Various technologies can provide protection, for example:</p> |
| 92 | <ul class="simple"> |
| 93 | <li>Process isolation in an operating system.</li> |
| 94 | <li>Partition isolation, either with a virtual machine or a partition manager.</li> |
| 95 | <li>Physical separation between devices.</li> |
| 96 | </ul> |
| 97 | <p>Communication between the frontend and backend is beyond the scope of this |
| 98 | specification.</p> |
| 99 | <p>In an isolated implementation, the backend can serve more than one |
| 100 | implementation instance. In this case, a single backend communicates with |
| 101 | multiple instances of the frontend. The backend must enforce <strong>caller |
| 102 | isolation</strong>: it must ensure that assets of one frontend are not visible to any |
| 103 | other frontend. The mechanism for identifying callers is beyond the scope of this |
| 104 | specification. An implementation that provides caller isolation must document |
| 105 | the identification mechanism. An implementation that provides isolation must |
| 106 | document any implementation-specific extension of the API that enables frontend |
| 107 | instances to share data in any form.</p> |
| 108 | <p>In summary, there are three types of implementation:</p> |
| 109 | <ul class="simple"> |
| 110 | <li>No isolation: there is no security boundary between the application and the |
| 111 | cryptoprocessor. For example, a statically or dynamically linked library is |
| 112 | an implementation with no isolation.</li> |
| 113 | <li>Cryptoprocessor isolation: there is a security boundary between the |
| 114 | application and the cryptoprocessor, but the cryptoprocessor does not |
| 115 | communicate with other applications. For example, a cryptoprocessor chip that |
| 116 | is a companion to an application processor is an implementation with |
| 117 | cryptoprocessor isolation.</li> |
| 118 | <li>Caller isolation: there are multiple application instances, with a security |
| 119 | boundary between the application instances among themselves, as well as |
| 120 | between the cryptoprocessor and the application instances. For example, a |
| 121 | cryptography service in a multiprocess environment is an implementation with |
| 122 | caller and cryptoprocessor isolation.</li> |
| 123 | </ul> |
| 124 | </div> |
| 125 | <div class="section" id="choice-of-algorithms"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 126 | <h2>2.4. Choice of algorithms</h2> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 127 | <p>The specification defines a low-level cryptographic interface, where the caller |
| 128 | explicitly chooses which algorithm and which security parameters they use. This |
| 129 | is necessary to implement protocols that are inescapable in various use cases. |
| 130 | The design of the interface enables applications to implement widely-used |
| 131 | protocols and data exchange formats, as well as custom ones.</p> |
| 132 | <p>As a consequence, all cryptographic functionality operates according to the |
| 133 | precise algorithm specified by the caller. However, this does not apply to |
| 134 | device-internal functionality, which does not involve any form of |
| 135 | interoperability, such as random number generation. The specification does not |
| 136 | include generic higher-level interfaces, where the implementation chooses the |
| 137 | best algorithm for a purpose. However, higher-level libraries can be built on |
| 138 | top of the PSA Crypto API.</p> |
| 139 | <p>Another consequence is that the specification permits the use of algorithms, key |
| 140 | sizes and other parameters that, while known to be insecure, might be necessary to |
| 141 | support legacy protocols or legacy data. Where major weaknesses are known, the |
| 142 | algorithm descriptions give applicable warnings. However, the lack of a warning |
| 143 | both does not and cannot indicate that an algorithm is secure in all circumstances. |
| 144 | Application developers need to research the security of the protocols and |
| 145 | algorithms that they plan to use to determine if these meet their requirements.</p> |
| 146 | <p>The interface facilitates algorithm agility. As a consequence, cryptographic |
| 147 | primitives are presented through generic functions with a parameter indicating |
| 148 | the specific choice of algorithm. For example, there is a single function to |
| 149 | calculate a message digest, which takes a parameter that identifies the specific |
| 150 | hash algorithm.</p> |
| 151 | </div> |
| 152 | <div class="section" id="ease-of-use"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 153 | <h2>2.5. Ease of use</h2> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 154 | <p>The interface is designed to be as user-friendly as possible, given the |
| 155 | aforementioned constraints on suitability for various types of devices and on |
| 156 | the freedom to choose algorithms.</p> |
| 157 | <p>In particular, the code flows are designed to reduce the risk of dangerous |
| 158 | misuse. The interface is designed in part to make it harder to misuse. Where |
| 159 | possible, it is designed so that |
| 160 | typical mistakes result in test failures, rather than subtle security issues. |
| 161 | Implementations avoid leaking data when a function is called with invalid |
| 162 | parameters, to the extent allowed by the C language and by implementation size |
| 163 | constraints.</p> |
| 164 | </div> |
| 165 | <div class="section" id="example-use-cases"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 166 | <h2>2.6. Example use cases</h2> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 167 | <p>This section lists some of the use cases that were considered during the design |
| 168 | of this API. This list is not exhaustive, nor are all implementations required to |
| 169 | support all use cases.</p> |
| 170 | <div class="section" id="network-security-tls"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 171 | <h3>2.6.1. Network Security (TLS)</h3> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 172 | <p>The API provides all of the cryptographic primitives needed to establish TLS |
| 173 | connections.</p> |
| 174 | </div> |
| 175 | <div class="section" id="secure-storage"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 176 | <h3>2.6.2. Secure Storage</h3> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 177 | <p>The API provides all primitives related to storage encryption, block or |
| 178 | file-based, with master encryption keys stored inside a key store.</p> |
| 179 | </div> |
| 180 | <div class="section" id="network-credentials"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 181 | <h3>2.6.3. Network Credentials</h3> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 182 | <p>The API provides network credential management inside a key store, for example, |
| 183 | for X.509-based authentication or pre-shared keys on enterprise networks.</p> |
| 184 | </div> |
| 185 | <div class="section" id="device-pairing"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 186 | <h3>2.6.4. Device Pairing</h3> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 187 | <p>The API provides support for key agreement protocols that are often used for |
| 188 | secure pairing of devices over wireless channels. For example, the pairing of an |
| 189 | NFC token or a Bluetooth device might use key agreement protocols upon |
| 190 | first use.</p> |
| 191 | </div> |
| 192 | <div class="section" id="secure-boot"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 193 | <h3>2.6.5. Secure Boot</h3> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 194 | <p>The API provides primitives for use during firmware integrity and authenticity |
| 195 | validation, during a secure or trusted boot process.</p> |
| 196 | </div> |
| 197 | <div class="section" id="attestation"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 198 | <h3>2.6.6. Attestation</h3> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 199 | <p>The API provides primitives used in attestation activities. Attestation is the |
| 200 | ability for a device to sign an array of bytes with a device private key and |
| 201 | return the result to the caller. There are several use cases; ranging from attestation |
| 202 | of the device state, to the ability to generate a key pair and prove that it has |
| 203 | been generated inside a secure key store. The API provides access to the |
| 204 | algorithms commonly used for attestation.</p> |
| 205 | </div> |
| 206 | <div class="section" id="factory-provisioning"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 207 | <h3>2.6.7. Factory Provisioning</h3> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 208 | <p>Most IoT devices receive a unique identity during the factory provisioning |
| 209 | process, or once they have been deployed to the field. This API provides the APIs necessary for |
| 210 | populating a device with keys that represent that identity.</p> |
| 211 | </div> |
| 212 | </div> |
| 213 | </div> |
| 214 | |
| 215 | |
| 216 | </div> |
| 217 | </div> |
| 218 | </div> |
| 219 | <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 220 | <div class="sphinxsidebarwrapper"><h3><a href="../index.html"><b>PSA Crypto API</b></a></h3> |
| 221 | IHI 0086<br/> |
| 222 | Non-confidential<br/> |
| 223 | Version 1.0.1 |
| 224 | <span style="color: red; font-weight: bold;"></span> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 225 | <ul> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 226 | <li class="toctree-l1"><a class="reference internal" href="../about.html">About this document</a></li> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 227 | </ul> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 228 | <ul class="current"> |
| 229 | <li class="toctree-l1"><a class="reference internal" href="intro.html">1. Introduction</a></li> |
| 230 | <li class="toctree-l1 current"><a class="current reference internal" href="#">2. Design goals</a><ul> |
| 231 | <li class="toctree-l2"><a class="reference internal" href="#suitable-for-constrained-devices">2.1. Suitable for constrained devices</a></li> |
| 232 | <li class="toctree-l2"><a class="reference internal" href="#a-keystore-interface">2.2. A keystore interface</a></li> |
| 233 | <li class="toctree-l2"><a class="reference internal" href="#optional-isolation">2.3. Optional isolation</a></li> |
| 234 | <li class="toctree-l2"><a class="reference internal" href="#choice-of-algorithms">2.4. Choice of algorithms</a></li> |
| 235 | <li class="toctree-l2"><a class="reference internal" href="#ease-of-use">2.5. Ease of use</a></li> |
| 236 | <li class="toctree-l2"><a class="reference internal" href="#example-use-cases">2.6. Example use cases</a><ul> |
| 237 | <li class="toctree-l3"><a class="reference internal" href="#network-security-tls">2.6.1. Network Security (TLS)</a></li> |
| 238 | <li class="toctree-l3"><a class="reference internal" href="#secure-storage">2.6.2. Secure Storage</a></li> |
| 239 | <li class="toctree-l3"><a class="reference internal" href="#network-credentials">2.6.3. Network Credentials</a></li> |
| 240 | <li class="toctree-l3"><a class="reference internal" href="#device-pairing">2.6.4. Device Pairing</a></li> |
| 241 | <li class="toctree-l3"><a class="reference internal" href="#secure-boot">2.6.5. Secure Boot</a></li> |
| 242 | <li class="toctree-l3"><a class="reference internal" href="#attestation">2.6.6. Attestation</a></li> |
| 243 | <li class="toctree-l3"><a class="reference internal" href="#factory-provisioning">2.6.7. Factory Provisioning</a></li> |
| 244 | </ul> |
| 245 | </li> |
| 246 | </ul> |
| 247 | </li> |
| 248 | <li class="toctree-l1"><a class="reference internal" href="functionality.html">3. Functionality overview</a></li> |
| 249 | <li class="toctree-l1"><a class="reference internal" href="sample-arch.html">4. Sample architectures</a></li> |
| 250 | <li class="toctree-l1"><a class="reference internal" href="conventions.html">5. Library conventions</a></li> |
| 251 | <li class="toctree-l1"><a class="reference internal" href="implementation.html">6. Implementation considerations</a></li> |
| 252 | <li class="toctree-l1"><a class="reference internal" href="usage.html">7. Usage considerations</a></li> |
| 253 | <li class="toctree-l1"><a class="reference internal" href="../api/library/index.html">8. Library management reference</a></li> |
| 254 | <li class="toctree-l1"><a class="reference internal" href="../api/keys/index.html">9. Key management reference</a></li> |
| 255 | <li class="toctree-l1"><a class="reference internal" href="../api/ops/index.html">10. Cryptographic operation reference</a></li> |
| 256 | </ul> |
| 257 | <ul> |
| 258 | <li class="toctree-l1"><a class="reference internal" href="../appendix/example_header.html">Example header file</a></li> |
| 259 | <li class="toctree-l1"><a class="reference internal" href="../appendix/specdef_values.html">Example macro implementations</a></li> |
| 260 | <li class="toctree-l1"><a class="reference internal" href="../appendix/history.html">Changes to the API</a></li> |
| 261 | </ul> |
| 262 | <ul> |
| 263 | <li class="toctree-l1"><a class="reference internal" href="../psa_c-identifiers.html">Index of API elements</a></li> |
| 264 | </ul> |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 265 | <div id="searchbox" style="display: none" role="search"> |
| 266 | <h3>Quick search</h3> |
| 267 | <form class="search" action="../search.html" method="get"> |
| 268 | <div><input type="text" name="q" /></div> |
| 269 | <div><input type="submit" value="Go" /></div> |
| 270 | <input type="hidden" name="check_keywords" value="yes" /> |
| 271 | <input type="hidden" name="area" value="default" /> |
| 272 | </form> |
| 273 | </div> |
| 274 | <script type="text/javascript">$('#searchbox').show(0);</script> |
| 275 | </div> |
| 276 | </div> |
| 277 | <div class="clearer"></div> |
| 278 | </div> |
| 279 | <div class="footer"> |
Gilles Peskine | c2db5f0 | 2021-01-18 20:36:53 +0100 | [diff] [blame^] | 280 | © 2018-2020, Arm Limited or its affiliates. All rights reserved. |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 281 | |
| 282 | | |
| 283 | Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.7</a> |
| 284 | & <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a> |
| 285 | |
Gilles Peskine | 6c723a2 | 2020-04-17 16:57:52 +0200 | [diff] [blame] | 286 | </div> |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | </body> |
| 292 | </html> |