blob: 97379e93a353499eb7bb4575a3493c67cd177e60 [file] [log] [blame]
Gilles Peskine6c723a22020-04-17 16:57:52 +02001
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 Peskinec2db5f02021-01-18 20:36:53 +01008 <title>8.2. PSA Crypto library &#8212; PSA Crypto API 1.0.1 documentation</title>
Gilles Peskine6c723a22020-04-17 16:57:52 +02009 <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 Peskinec2db5f02021-01-18 20:36:53 +010014 VERSION: '1.0.1',
Gilles Peskine6c723a22020-04-17 16:57:52 +020015 COLLAPSE_INDEX: false,
16 FILE_SUFFIX: '.html',
Gilles Peskinec2db5f02021-01-18 20:36:53 +010017 HAS_SOURCE: false,
Gilles Peskine6c723a22020-04-17 16:57:52 +020018 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 Peskinec2db5f02021-01-18 20:36:53 +010024 <link rel="author" title="About these documents" href="../../about.html" />
Gilles Peskine6c723a22020-04-17 16:57:52 +020025 <link rel="index" title="Index" href="../../genindex.html" />
26 <link rel="search" title="Search" href="../../search.html" />
Gilles Peskinec2db5f02021-01-18 20:36:53 +010027 <link rel="next" title="9. Key management reference" href="../keys/index.html" />
28 <link rel="prev" title="8.1. PSA status codes" href="status.html" />
Gilles Peskine6c723a22020-04-17 16:57:52 +020029
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="psa-crypto-library">
Gilles Peskinec2db5f02021-01-18 20:36:53 +010044<h1>8.2. PSA Crypto library</h1>
Gilles Peskine6c723a22020-04-17 16:57:52 +020045<div class="section" id="api-version">
Gilles Peskinec2db5f02021-01-18 20:36:53 +010046<span id="id1"></span><h2>8.2.1. API version</h2>
Gilles Peskine6c723a22020-04-17 16:57:52 +020047<div class="section" id="PSA_CRYPTO_API_VERSION_MAJOR">
48<span id="c.PSA_CRYPTO_API_VERSION_MAJOR"></span><h3><code class="docutils literal"><span class="pre">PSA_CRYPTO_API_VERSION_MAJOR</span></code> (macro)</h3>
49<p>The major version of this implementation of the PSA Crypto API.</p>
50<pre class="literal-block">
51#define <a class="reference internal" href="#c.PSA_CRYPTO_API_VERSION_MAJOR" title="PSA_CRYPTO_API_VERSION_MAJOR">PSA_CRYPTO_API_VERSION_MAJOR</a> 1
52</pre>
53</div>
54<div class="section" id="PSA_CRYPTO_API_VERSION_MINOR">
55<span id="c.PSA_CRYPTO_API_VERSION_MINOR"></span><h3><code class="docutils literal"><span class="pre">PSA_CRYPTO_API_VERSION_MINOR</span></code> (macro)</h3>
56<p>The minor version of this implementation of the PSA Crypto API.</p>
57<pre class="literal-block">
58#define <a class="reference internal" href="#c.PSA_CRYPTO_API_VERSION_MINOR" title="PSA_CRYPTO_API_VERSION_MINOR">PSA_CRYPTO_API_VERSION_MINOR</a> 0
59</pre>
60</div>
61</div>
62<div class="section" id="library-initialization">
Gilles Peskinec2db5f02021-01-18 20:36:53 +010063<span id="library-init"></span><h2>8.2.2. Library initialization</h2>
Gilles Peskine6c723a22020-04-17 16:57:52 +020064<div class="section" id="psa_crypto_init">
65<span id="c.psa_crypto_init"></span><h3><code class="docutils literal"><span class="pre">psa_crypto_init</span></code> (function)</h3>
66<p>Library initialization.</p>
67<pre class="literal-block">
68<a class="reference internal" href="status.html#c.psa_status_t" title="psa_status_t">psa_status_t</a> <a class="reference internal" href="#c.psa_crypto_init" title="psa_crypto_init">psa_crypto_init</a>(void);
69</pre>
70<p class="rubric">Returns: <a class="reference internal" href="status.html#c.psa_status_t" title="psa_status_t"><code class="docutils literal"><span class="pre">psa_status_t</span></code></a></p>
71<dl class="docutils">
72<dt> <a class="reference internal" href="status.html#c.PSA_SUCCESS" title="PSA_SUCCESS"><code class="docutils literal"><span class="pre">PSA_SUCCESS</span></code></a></dt>
73<dd></dd>
74<dt> <a class="reference internal" href="status.html#c.PSA_ERROR_INSUFFICIENT_MEMORY" title="PSA_ERROR_INSUFFICIENT_MEMORY"><code class="docutils literal"><span class="pre">PSA_ERROR_INSUFFICIENT_MEMORY</span></code></a></dt>
75<dd></dd>
76<dt> <a class="reference internal" href="status.html#c.PSA_ERROR_COMMUNICATION_FAILURE" title="PSA_ERROR_COMMUNICATION_FAILURE"><code class="docutils literal"><span class="pre">PSA_ERROR_COMMUNICATION_FAILURE</span></code></a></dt>
77<dd></dd>
78<dt> <a class="reference internal" href="status.html#c.PSA_ERROR_HARDWARE_FAILURE" title="PSA_ERROR_HARDWARE_FAILURE"><code class="docutils literal"><span class="pre">PSA_ERROR_HARDWARE_FAILURE</span></code></a></dt>
79<dd></dd>
80<dt> <a class="reference internal" href="status.html#c.PSA_ERROR_CORRUPTION_DETECTED" title="PSA_ERROR_CORRUPTION_DETECTED"><code class="docutils literal"><span class="pre">PSA_ERROR_CORRUPTION_DETECTED</span></code></a></dt>
81<dd></dd>
82<dt> <a class="reference internal" href="status.html#c.PSA_ERROR_INSUFFICIENT_ENTROPY" title="PSA_ERROR_INSUFFICIENT_ENTROPY"><code class="docutils literal"><span class="pre">PSA_ERROR_INSUFFICIENT_ENTROPY</span></code></a></dt>
83<dd></dd>
84</dl>
85<p class="rubric">Description</p>
86<p>Applications must call this function before calling any other function in this module.</p>
87<p>Applications are permitted to call this function more than once. Once a call succeeds, subsequent calls are guaranteed to succeed.</p>
88<p>If the application calls other functions before calling <a class="reference internal" href="#c.psa_crypto_init" title="psa_crypto_init"><code class="xref any c c-func docutils literal"><span class="pre">psa_crypto_init()</span></code></a>, the behavior is undefined. In this situation:</p>
89<ul class="simple">
90<li>Implementations are encouraged to either perform the operation as if the library had been initialized or to return <a class="reference internal" href="status.html#c.PSA_ERROR_BAD_STATE" title="PSA_ERROR_BAD_STATE"><code class="xref any c c-macro docutils literal"><span class="pre">PSA_ERROR_BAD_STATE</span></code></a> or some other applicable error.</li>
91<li>Implementations must not return a success status if the lack of initialization might have security implications, for example due to improper seeding of the random number generator.</li>
92</ul>
93</div>
94</div>
95</div>
96
97
98 </div>
99 </div>
100 </div>
101 <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100102 <div class="sphinxsidebarwrapper"><h3><a href="../../index.html"><b>PSA Crypto API</b></a></h3>
103IHI 0086<br/>
104Non-confidential<br/>
105Version 1.0.1
106<span style="color: red; font-weight: bold;"></span>
Gilles Peskine6c723a22020-04-17 16:57:52 +0200107<ul>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100108<li class="toctree-l1"><a class="reference internal" href="../../about.html">About this document</a></li>
Gilles Peskine6c723a22020-04-17 16:57:52 +0200109</ul>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100110<ul class="current">
111<li class="toctree-l1"><a class="reference internal" href="../../overview/intro.html">1. Introduction</a></li>
112<li class="toctree-l1"><a class="reference internal" href="../../overview/goals.html">2. Design goals</a></li>
113<li class="toctree-l1"><a class="reference internal" href="../../overview/functionality.html">3. Functionality overview</a></li>
114<li class="toctree-l1"><a class="reference internal" href="../../overview/sample-arch.html">4. Sample architectures</a></li>
115<li class="toctree-l1"><a class="reference internal" href="../../overview/conventions.html">5. Library conventions</a></li>
116<li class="toctree-l1"><a class="reference internal" href="../../overview/implementation.html">6. Implementation considerations</a></li>
117<li class="toctree-l1"><a class="reference internal" href="../../overview/usage.html">7. Usage considerations</a></li>
118<li class="toctree-l1 current"><a class="reference internal" href="index.html">8. Library management reference</a><ul class="current">
119<li class="toctree-l2"><a class="reference internal" href="status.html">8.1. PSA status codes</a></li>
120<li class="toctree-l2 current"><a class="current reference internal" href="#">8.2. PSA Crypto library</a><ul>
121<li class="toctree-l3"><a class="reference internal" href="#api-version">8.2.1. API version</a></li>
122<li class="toctree-l3"><a class="reference internal" href="#library-initialization">8.2.2. Library initialization</a></li>
123</ul>
124</li>
125</ul>
126</li>
127<li class="toctree-l1"><a class="reference internal" href="../keys/index.html">9. Key management reference</a></li>
128<li class="toctree-l1"><a class="reference internal" href="../ops/index.html">10. Cryptographic operation reference</a></li>
129</ul>
130<ul>
131<li class="toctree-l1"><a class="reference internal" href="../../appendix/example_header.html">Example header file</a></li>
132<li class="toctree-l1"><a class="reference internal" href="../../appendix/specdef_values.html">Example macro implementations</a></li>
133<li class="toctree-l1"><a class="reference internal" href="../../appendix/history.html">Changes to the API</a></li>
134</ul>
135<ul>
136<li class="toctree-l1"><a class="reference internal" href="../../psa_c-identifiers.html">Index of API elements</a></li>
137</ul>
Gilles Peskine6c723a22020-04-17 16:57:52 +0200138<div id="searchbox" style="display: none" role="search">
139 <h3>Quick search</h3>
140 <form class="search" action="../../search.html" method="get">
141 <div><input type="text" name="q" /></div>
142 <div><input type="submit" value="Go" /></div>
143 <input type="hidden" name="check_keywords" value="yes" />
144 <input type="hidden" name="area" value="default" />
145 </form>
146</div>
147<script type="text/javascript">$('#searchbox').show(0);</script>
148 </div>
149 </div>
150 <div class="clearer"></div>
151 </div>
152 <div class="footer">
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100153 &copy; 2018-2020, Arm Limited or its affiliates. All rights reserved.
Gilles Peskine6c723a22020-04-17 16:57:52 +0200154
155 |
156 Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.7</a>
157 &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
158
Gilles Peskine6c723a22020-04-17 16:57:52 +0200159 </div>
160
161
162
163
164 </body>
165</html>