blob: d15450f58cb158fbe066a4497d196156768bc58e [file] [log] [blame]
Gilles Peskine6c723a22020-04-17 16:57:52 +02001
Bence Szépkútie26ccad2021-02-01 14:26:11 +01002<!DOCTYPE html>
Gilles Peskine6c723a22020-04-17 16:57:52 +02003
4<html xmlns="http://www.w3.org/1999/xhtml">
5 <head>
Bence Szépkútie26ccad2021-02-01 14:26:11 +01006 <meta charset="utf-8" />
Gilles Peskinec2db5f02021-01-18 20:36:53 +01007 <title>8.2. PSA Crypto library &#8212; PSA Crypto API 1.0.1 documentation</title>
Gilles Peskine6c723a22020-04-17 16:57:52 +02008 <link rel="stylesheet" href="../../_static/alabaster.css" type="text/css" />
9 <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
Bence Szépkútie26ccad2021-02-01 14:26:11 +010010 <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
Gilles Peskine6c723a22020-04-17 16:57:52 +020011 <script type="text/javascript" src="../../_static/jquery.js"></script>
12 <script type="text/javascript" src="../../_static/underscore.js"></script>
13 <script type="text/javascript" src="../../_static/doctools.js"></script>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010014 <script type="text/javascript" src="../../_static/language_data.js"></script>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010015 <link rel="author" title="About these documents" href="../../about.html" />
Gilles Peskine6c723a22020-04-17 16:57:52 +020016 <link rel="index" title="Index" href="../../genindex.html" />
17 <link rel="search" title="Search" href="../../search.html" />
Gilles Peskinec2db5f02021-01-18 20:36:53 +010018 <link rel="next" title="9. Key management reference" href="../keys/index.html" />
19 <link rel="prev" title="8.1. PSA status codes" href="status.html" />
Gilles Peskine6c723a22020-04-17 16:57:52 +020020
21 <link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
22
Bence Szépkútie26ccad2021-02-01 14:26:11 +010023
Gilles Peskine6c723a22020-04-17 16:57:52 +020024 <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
25
Bence Szépkútie26ccad2021-02-01 14:26:11 +010026 </head><body>
Gilles Peskine6c723a22020-04-17 16:57:52 +020027
28
29 <div class="document">
30 <div class="documentwrapper">
31 <div class="bodywrapper">
Bence Szépkútie26ccad2021-02-01 14:26:11 +010032
33
Gilles Peskine6c723a22020-04-17 16:57:52 +020034 <div class="body" role="main">
35
36 <div class="section" id="psa-crypto-library">
Gilles Peskinec2db5f02021-01-18 20:36:53 +010037<h1>8.2. PSA Crypto library</h1>
Gilles Peskine6c723a22020-04-17 16:57:52 +020038<div class="section" id="api-version">
Gilles Peskinec2db5f02021-01-18 20:36:53 +010039<span id="id1"></span><h2>8.2.1. API version</h2>
Gilles Peskine6c723a22020-04-17 16:57:52 +020040<div class="section" id="PSA_CRYPTO_API_VERSION_MAJOR">
Bence Szépkútie26ccad2021-02-01 14:26:11 +010041<span id="c.PSA_CRYPTO_API_VERSION_MAJOR"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_CRYPTO_API_VERSION_MAJOR</span></code> (macro)</h3>
Gilles Peskine6c723a22020-04-17 16:57:52 +020042<p>The major version of this implementation of the PSA Crypto API.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010043<pre class="literal-block">#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</pre>
Gilles Peskine6c723a22020-04-17 16:57:52 +020044</div>
45<div class="section" id="PSA_CRYPTO_API_VERSION_MINOR">
Bence Szépkútie26ccad2021-02-01 14:26:11 +010046<span id="c.PSA_CRYPTO_API_VERSION_MINOR"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_CRYPTO_API_VERSION_MINOR</span></code> (macro)</h3>
Gilles Peskine6c723a22020-04-17 16:57:52 +020047<p>The minor version of this implementation of the PSA Crypto API.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010048<pre class="literal-block">#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</pre>
Gilles Peskine6c723a22020-04-17 16:57:52 +020049</div>
50</div>
51<div class="section" id="library-initialization">
Gilles Peskinec2db5f02021-01-18 20:36:53 +010052<span id="library-init"></span><h2>8.2.2. Library initialization</h2>
Gilles Peskine6c723a22020-04-17 16:57:52 +020053<div class="section" id="psa_crypto_init">
Bence Szépkútie26ccad2021-02-01 14:26:11 +010054<span id="c.psa_crypto_init"></span><h3><code class="docutils literal notranslate"><span class="pre">psa_crypto_init</span></code> (function)</h3>
Gilles Peskine6c723a22020-04-17 16:57:52 +020055<p>Library initialization.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010056<pre class="literal-block"><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);</pre>
57<p class="rubric">Returns: <a class="reference internal" href="status.html#c.psa_status_t" title="psa_status_t"><code class="docutils literal notranslate"><span class="pre">psa_status_t</span></code></a></p>
58<dl class="simple">
59<dt> <a class="reference internal" href="status.html#c.PSA_SUCCESS" title="PSA_SUCCESS"><code class="docutils literal notranslate"><span class="pre">PSA_SUCCESS</span></code></a></dt><dd></dd>
60<dt> <a class="reference internal" href="status.html#c.PSA_ERROR_INSUFFICIENT_MEMORY" title="PSA_ERROR_INSUFFICIENT_MEMORY"><code class="docutils literal notranslate"><span class="pre">PSA_ERROR_INSUFFICIENT_MEMORY</span></code></a></dt><dd></dd>
61<dt> <a class="reference internal" href="status.html#c.PSA_ERROR_COMMUNICATION_FAILURE" title="PSA_ERROR_COMMUNICATION_FAILURE"><code class="docutils literal notranslate"><span class="pre">PSA_ERROR_COMMUNICATION_FAILURE</span></code></a></dt><dd></dd>
62<dt> <a class="reference internal" href="status.html#c.PSA_ERROR_HARDWARE_FAILURE" title="PSA_ERROR_HARDWARE_FAILURE"><code class="docutils literal notranslate"><span class="pre">PSA_ERROR_HARDWARE_FAILURE</span></code></a></dt><dd></dd>
63<dt> <a class="reference internal" href="status.html#c.PSA_ERROR_CORRUPTION_DETECTED" title="PSA_ERROR_CORRUPTION_DETECTED"><code class="docutils literal notranslate"><span class="pre">PSA_ERROR_CORRUPTION_DETECTED</span></code></a></dt><dd></dd>
64<dt> <a class="reference internal" href="status.html#c.PSA_ERROR_INSUFFICIENT_ENTROPY" title="PSA_ERROR_INSUFFICIENT_ENTROPY"><code class="docutils literal notranslate"><span class="pre">PSA_ERROR_INSUFFICIENT_ENTROPY</span></code></a></dt><dd></dd>
Gilles Peskine6c723a22020-04-17 16:57:52 +020065</dl>
66<p class="rubric">Description</p>
67<p>Applications must call this function before calling any other function in this module.</p>
68<p>Applications are permitted to call this function more than once. Once a call succeeds, subsequent calls are guaranteed to succeed.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010069<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 notranslate"><span class="pre">psa_crypto_init()</span></code></a>, the behavior is undefined. In this situation:</p>
Gilles Peskine6c723a22020-04-17 16:57:52 +020070<ul class="simple">
Bence Szépkútie26ccad2021-02-01 14:26:11 +010071<li><p>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 notranslate"><span class="pre">PSA_ERROR_BAD_STATE</span></code></a> or some other applicable error.</p></li>
72<li><p>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.</p></li>
Gilles Peskine6c723a22020-04-17 16:57:52 +020073</ul>
74</div>
75</div>
76</div>
77
78
79 </div>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010080
Gilles Peskine6c723a22020-04-17 16:57:52 +020081 </div>
82 </div>
83 <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
Gilles Peskinec2db5f02021-01-18 20:36:53 +010084 <div class="sphinxsidebarwrapper"><h3><a href="../../index.html"><b>PSA Crypto API</b></a></h3>
85IHI 0086<br/>
86Non-confidential<br/>
87Version 1.0.1
88<span style="color: red; font-weight: bold;"></span>
Gilles Peskine6c723a22020-04-17 16:57:52 +020089<ul>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010090<li class="toctree-l1"><a class="reference internal" href="../../about.html">About this document</a></li>
Gilles Peskine6c723a22020-04-17 16:57:52 +020091</ul>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010092<ul class="current">
93<li class="toctree-l1"><a class="reference internal" href="../../overview/intro.html">1. Introduction</a></li>
94<li class="toctree-l1"><a class="reference internal" href="../../overview/goals.html">2. Design goals</a></li>
95<li class="toctree-l1"><a class="reference internal" href="../../overview/functionality.html">3. Functionality overview</a></li>
96<li class="toctree-l1"><a class="reference internal" href="../../overview/sample-arch.html">4. Sample architectures</a></li>
97<li class="toctree-l1"><a class="reference internal" href="../../overview/conventions.html">5. Library conventions</a></li>
98<li class="toctree-l1"><a class="reference internal" href="../../overview/implementation.html">6. Implementation considerations</a></li>
99<li class="toctree-l1"><a class="reference internal" href="../../overview/usage.html">7. Usage considerations</a></li>
100<li class="toctree-l1 current"><a class="reference internal" href="index.html">8. Library management reference</a><ul class="current">
101<li class="toctree-l2"><a class="reference internal" href="status.html">8.1. PSA status codes</a></li>
102<li class="toctree-l2 current"><a class="current reference internal" href="#">8.2. PSA Crypto library</a><ul>
103<li class="toctree-l3"><a class="reference internal" href="#api-version">8.2.1. API version</a></li>
104<li class="toctree-l3"><a class="reference internal" href="#library-initialization">8.2.2. Library initialization</a></li>
105</ul>
106</li>
107</ul>
108</li>
109<li class="toctree-l1"><a class="reference internal" href="../keys/index.html">9. Key management reference</a></li>
110<li class="toctree-l1"><a class="reference internal" href="../ops/index.html">10. Cryptographic operation reference</a></li>
111</ul>
112<ul>
113<li class="toctree-l1"><a class="reference internal" href="../../appendix/example_header.html">Example header file</a></li>
114<li class="toctree-l1"><a class="reference internal" href="../../appendix/specdef_values.html">Example macro implementations</a></li>
115<li class="toctree-l1"><a class="reference internal" href="../../appendix/history.html">Changes to the API</a></li>
116</ul>
117<ul>
118<li class="toctree-l1"><a class="reference internal" href="../../psa_c-identifiers.html">Index of API elements</a></li>
119</ul>
Gilles Peskine6c723a22020-04-17 16:57:52 +0200120<div id="searchbox" style="display: none" role="search">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100121 <h3 id="searchlabel">Quick search</h3>
122 <div class="searchformwrapper">
Gilles Peskine6c723a22020-04-17 16:57:52 +0200123 <form class="search" action="../../search.html" method="get">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100124 <input type="text" name="q" aria-labelledby="searchlabel" />
125 <input type="submit" value="Go" />
Gilles Peskine6c723a22020-04-17 16:57:52 +0200126 </form>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100127 </div>
Gilles Peskine6c723a22020-04-17 16:57:52 +0200128</div>
129<script type="text/javascript">$('#searchbox').show(0);</script>
130 </div>
131 </div>
132 <div class="clearer"></div>
133 </div>
134 <div class="footer">
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100135 &copy; 2018-2020, Arm Limited or its affiliates. All rights reserved.
Gilles Peskine6c723a22020-04-17 16:57:52 +0200136
137 |
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100138 Powered by <a href="http://sphinx-doc.org/">Sphinx 2.1.2</a>
139 &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
Gilles Peskine6c723a22020-04-17 16:57:52 +0200140
Gilles Peskine6c723a22020-04-17 16:57:52 +0200141 </div>
142
143
144
145
146 </body>
147</html>