blob: 786d7d860cbf3650f5dc03e46eb28aca1b30ca54 [file] [log] [blame]
Gilles Peskinec2db5f02021-01-18 20:36:53 +01001
Bence Szépkútie26ccad2021-02-01 14:26:11 +01002<!DOCTYPE html>
Gilles Peskinec2db5f02021-01-18 20:36:53 +01003
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>10.1. Algorithms &#8212; PSA Crypto API 1.0.1 documentation</title>
8 <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 Peskinec2db5f02021-01-18 20:36:53 +010011 <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" />
16 <link rel="index" title="Index" href="../../genindex.html" />
17 <link rel="search" title="Search" href="../../search.html" />
18 <link rel="next" title="10.2. Message digests" href="hashes.html" />
19 <link rel="prev" title="10. Cryptographic operation reference" href="index.html" />
20
21 <link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
22
Bence Szépkútie26ccad2021-02-01 14:26:11 +010023
Gilles Peskinec2db5f02021-01-18 20:36:53 +010024 <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 Peskinec2db5f02021-01-18 20:36:53 +010027
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 Peskinec2db5f02021-01-18 20:36:53 +010034 <div class="body" role="main">
35
36 <div class="section" id="algorithms">
37<span id="id1"></span><h1>10.1. Algorithms</h1>
38<p>This specification encodes algorithms into a structured 32-bit integer value.</p>
39<p>Algorithm identifiers are used for two purposes in this API:</p>
40<ol class="arabic simple">
Bence Szépkútie26ccad2021-02-01 14:26:11 +010041<li><p>To specify a specific algorithm to use in a cryptographic operation. These are all defined in <a class="reference internal" href="index.html#crypto-operations"><span class="secref">Cryptographic operation reference</span></a>.</p></li>
42<li><p>To specify the policy for a key, identifying the permitted algorithm for use with the key. This use is described in <a class="reference internal" href="../keys/policy.html#key-policy"><span class="secref">Key policies</span></a>.</p></li>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010043</ol>
44<p>The specific algorithm identifiers are described alongside the cryptographic operation functions to which they apply:</p>
45<ul class="simple">
Bence Szépkútie26ccad2021-02-01 14:26:11 +010046<li><p><a class="reference internal" href="hashes.html#hash-algorithms"><span class="secref">Hash algorithms</span></a></p></li>
47<li><p><a class="reference internal" href="macs.html#mac-algorithms"><span class="secref">MAC algorithms</span></a></p></li>
48<li><p><a class="reference internal" href="ciphers.html#cipher-algorithms"><span class="secref">Cipher algorithms</span></a></p></li>
49<li><p><a class="reference internal" href="aead.html#aead-algorithms"><span class="secref">AEAD algorithms</span></a></p></li>
50<li><p><a class="reference internal" href="kdf.html#key-derivation-algorithms"><span class="secref">Key derivation algorithms</span></a></p></li>
51<li><p><a class="reference internal" href="sign.html#sign-algorithms"><span class="secref">Asymmetric signature algorithms</span></a></p></li>
52<li><p><a class="reference internal" href="pke.html#asymmetric-encryption-algorithms"><span class="secref">Asymmetric encryption algorithms</span></a></p></li>
53<li><p><a class="reference internal" href="ka.html#key-agreement-algorithms"><span class="secref">Key agreement algorithms</span></a></p></li>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010054</ul>
55<div class="section" id="algorithm-encoding">
56<h2>10.1.1. Algorithm encoding</h2>
57<div class="section" id="psa_algorithm_t">
Bence Szépkútie26ccad2021-02-01 14:26:11 +010058<span id="c.psa_algorithm_t"></span><h3><code class="docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code> (type)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010059<p>Encoding of a cryptographic algorithm.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010060<pre class="literal-block">typedef uint32_t <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t">psa_algorithm_t</a>;</pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010061<p>This is a structured bitfield that identifies the category and type of algorithm. The range of algorithm identifier values is divided as follows:</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010062<dl class="simple">
63<dt><code class="docutils literal notranslate"><span class="pre">0</span></code><code class="docutils literal notranslate"><span class="pre">x00000000</span></code></dt><dd><p>Reserved as an invalid algorithm identifier.</p>
64</dd>
65<dt><code class="docutils literal notranslate"><span class="pre">0</span></code><code class="docutils literal notranslate"><span class="pre">x00000001</span></code><code class="docutils literal notranslate"> <span class="pre">-</span> <span class="pre">0</span></code><code class="docutils literal notranslate"><span class="pre">x7fffffff</span></code></dt><dd><p>Specification-defined algorithm identifiers.
Gilles Peskinec2db5f02021-01-18 20:36:53 +010066Algorithm identifiers defined by this standard always have bit 31 clear.
Bence Szépkútie26ccad2021-02-01 14:26:11 +010067Unallocated algorithm identifier values in this range are reserved for future use.</p>
68</dd>
69<dt><code class="docutils literal notranslate"><span class="pre">0</span></code><code class="docutils literal notranslate"><span class="pre">x80000000</span></code><code class="docutils literal notranslate"> <span class="pre">-</span> <span class="pre">0</span></code><code class="docutils literal notranslate"><span class="pre">xffffffff</span></code></dt><dd><p>Implementation-defined algorithm identifiers.
Gilles Peskinec2db5f02021-01-18 20:36:53 +010070Implementations that define additional algorithms must use an encoding with bit 31 set.
Bence Szépkútie26ccad2021-02-01 14:26:11 +010071The related support macros will be easier to write if these algorithm identifier encodings also respect the bitwise structure used by standard encodings.</p>
72</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010073</dl>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010074<p>For algorithms that can be applied to multiple key types, this identifier does not encode the key type. For example, for symmetric ciphers based on a block cipher, <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a> encodes the block cipher mode and the padding mode while the block cipher itself is encoded via <a class="reference internal" href="../keys/types.html#c.psa_key_type_t" title="psa_key_type_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_key_type_t</span></code></a>.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010075</div>
76<div class="section" id="PSA_ALG_NONE">
Bence Szépkútie26ccad2021-02-01 14:26:11 +010077<span id="c.PSA_ALG_NONE"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_NONE</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010078<p>An invalid algorithm identifier value.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010079<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_NONE" title="PSA_ALG_NONE">PSA_ALG_NONE</a> ((<a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t">psa_algorithm_t</a>)0)</pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010080<p>Zero is not the encoding of any algorithm.</p>
81</div>
82</div>
83<div class="section" id="algorithm-categories">
84<h2>10.1.2. Algorithm categories</h2>
85<div class="section" id="PSA_ALG_IS_HASH">
Bence Szépkútie26ccad2021-02-01 14:26:11 +010086<span id="c.PSA_ALG_IS_HASH"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_IS_HASH</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010087<p>Whether the specified algorithm is a hash algorithm.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010088<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_IS_HASH" title="PSA_ALG_IS_HASH">PSA_ALG_IS_HASH</a>(alg) <em><a class="reference internal" href="../../overview/implementation.html#specification-defined-value"><span class="std std-ref">/* specification-defined value */</span></a></em></pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010089<p class="rubric">Parameters</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010090<dl class="simple">
91<dt> <code class="docutils literal notranslate"><span class="pre">alg</span></code></dt><dd><p>An algorithm identifier (value of type <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a>).</p>
92</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010093</dl>
94<p class="rubric">Returns</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +010095<p><code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is a hash algorithm, <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise. This macro can return either <code class="docutils literal notranslate"><span class="pre">0</span></code> or <code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is not a supported algorithm identifier.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +010096<p class="rubric">Description</p>
97<p>See <a class="reference internal" href="hashes.html#hash-algorithms"><span class="secref">Hash algorithms</span></a> for a list of defined hash algorithms.</p>
98</div>
99<div class="section" id="PSA_ALG_IS_MAC">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100100<span id="c.PSA_ALG_IS_MAC"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_IS_MAC</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100101<p>Whether the specified algorithm is a MAC algorithm.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100102<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_IS_MAC" title="PSA_ALG_IS_MAC">PSA_ALG_IS_MAC</a>(alg) <em><a class="reference internal" href="../../overview/implementation.html#specification-defined-value"><span class="std std-ref">/* specification-defined value */</span></a></em></pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100103<p class="rubric">Parameters</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100104<dl class="simple">
105<dt> <code class="docutils literal notranslate"><span class="pre">alg</span></code></dt><dd><p>An algorithm identifier (value of type <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a>).</p>
106</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100107</dl>
108<p class="rubric">Returns</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100109<p><code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is a MAC algorithm, <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise. This macro can return either <code class="docutils literal notranslate"><span class="pre">0</span></code> or <code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is not a supported algorithm identifier.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100110<p class="rubric">Description</p>
111<p>See <a class="reference internal" href="macs.html#mac-algorithms"><span class="secref">MAC algorithms</span></a> for a list of defined MAC algorithms.</p>
112</div>
113<div class="section" id="PSA_ALG_IS_CIPHER">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100114<span id="c.PSA_ALG_IS_CIPHER"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_IS_CIPHER</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100115<p>Whether the specified algorithm is a symmetric cipher algorithm.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100116<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_IS_CIPHER" title="PSA_ALG_IS_CIPHER">PSA_ALG_IS_CIPHER</a>(alg) <em><a class="reference internal" href="../../overview/implementation.html#specification-defined-value"><span class="std std-ref">/* specification-defined value */</span></a></em></pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100117<p class="rubric">Parameters</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100118<dl class="simple">
119<dt> <code class="docutils literal notranslate"><span class="pre">alg</span></code></dt><dd><p>An algorithm identifier (value of type <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a>).</p>
120</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100121</dl>
122<p class="rubric">Returns</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100123<p><code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is a symmetric cipher algorithm, <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise. This macro can return either <code class="docutils literal notranslate"><span class="pre">0</span></code> or <code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is not a supported algorithm identifier.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100124<p class="rubric">Description</p>
125<p>See <a class="reference internal" href="ciphers.html#cipher-algorithms"><span class="secref">Cipher algorithms</span></a> for a list of defined cipher algorithms.</p>
126</div>
127<div class="section" id="PSA_ALG_IS_AEAD">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100128<span id="c.PSA_ALG_IS_AEAD"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_IS_AEAD</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100129<p>Whether the specified algorithm is an authenticated encryption with associated data (AEAD) algorithm.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100130<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_IS_AEAD" title="PSA_ALG_IS_AEAD">PSA_ALG_IS_AEAD</a>(alg) <em><a class="reference internal" href="../../overview/implementation.html#specification-defined-value"><span class="std std-ref">/* specification-defined value */</span></a></em></pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100131<p class="rubric">Parameters</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100132<dl class="simple">
133<dt> <code class="docutils literal notranslate"><span class="pre">alg</span></code></dt><dd><p>An algorithm identifier (value of type <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a>).</p>
134</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100135</dl>
136<p class="rubric">Returns</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100137<p><code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is an AEAD algorithm, <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise. This macro can return either <code class="docutils literal notranslate"><span class="pre">0</span></code> or <code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is not a supported algorithm identifier.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100138<p class="rubric">Description</p>
139<p>See <a class="reference internal" href="aead.html#aead-algorithms"><span class="secref">AEAD algorithms</span></a> for a list of defined AEAD algorithms.</p>
140</div>
141<div class="section" id="PSA_ALG_IS_SIGN">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100142<span id="c.PSA_ALG_IS_SIGN"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_IS_SIGN</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100143<p>Whether the specified algorithm is an asymmetric signature algorithm, also known as public-key signature algorithm.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100144<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_IS_SIGN" title="PSA_ALG_IS_SIGN">PSA_ALG_IS_SIGN</a>(alg) <em><a class="reference internal" href="../../overview/implementation.html#specification-defined-value"><span class="std std-ref">/* specification-defined value */</span></a></em></pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100145<p class="rubric">Parameters</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100146<dl class="simple">
147<dt> <code class="docutils literal notranslate"><span class="pre">alg</span></code></dt><dd><p>An algorithm identifier (value of type <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a>).</p>
148</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100149</dl>
150<p class="rubric">Returns</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100151<p><code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is an asymmetric signature algorithm, <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise. This macro can return either <code class="docutils literal notranslate"><span class="pre">0</span></code> or <code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is not a supported algorithm identifier.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100152<p class="rubric">Description</p>
153<p>See <a class="reference internal" href="sign.html#sign-algorithms"><span class="secref">Asymmetric signature algorithms</span></a> for a list of defined signature algorithms.</p>
154</div>
155<div class="section" id="PSA_ALG_IS_ASYMMETRIC_ENCRYPTION">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100156<span id="c.PSA_ALG_IS_ASYMMETRIC_ENCRYPTION"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_IS_ASYMMETRIC_ENCRYPTION</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100157<p>Whether the specified algorithm is an asymmetric encryption algorithm, also known as public-key encryption algorithm.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100158<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_IS_ASYMMETRIC_ENCRYPTION" title="PSA_ALG_IS_ASYMMETRIC_ENCRYPTION">PSA_ALG_IS_ASYMMETRIC_ENCRYPTION</a>(alg) <em><a class="reference internal" href="../../overview/implementation.html#specification-defined-value"><span class="std std-ref">/* specification-defined value */</span></a></em></pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100159<p class="rubric">Parameters</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100160<dl class="simple">
161<dt> <code class="docutils literal notranslate"><span class="pre">alg</span></code></dt><dd><p>An algorithm identifier (value of type <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a>).</p>
162</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100163</dl>
164<p class="rubric">Returns</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100165<p><code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is an asymmetric encryption algorithm, <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise. This macro can return either <code class="docutils literal notranslate"><span class="pre">0</span></code> or <code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is not a supported algorithm identifier.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100166<p class="rubric">Description</p>
167<p>See <a class="reference internal" href="pke.html#asymmetric-encryption-algorithms"><span class="secref">Asymmetric encryption algorithms</span></a> for a list of defined asymmetric encryption algorithms.</p>
168</div>
169<div class="section" id="PSA_ALG_IS_KEY_AGREEMENT">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100170<span id="c.PSA_ALG_IS_KEY_AGREEMENT"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_IS_KEY_AGREEMENT</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100171<p>Whether the specified algorithm is a key agreement algorithm.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100172<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_IS_KEY_AGREEMENT" title="PSA_ALG_IS_KEY_AGREEMENT">PSA_ALG_IS_KEY_AGREEMENT</a>(alg) <em><a class="reference internal" href="../../overview/implementation.html#specification-defined-value"><span class="std std-ref">/* specification-defined value */</span></a></em></pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100173<p class="rubric">Parameters</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100174<dl class="simple">
175<dt> <code class="docutils literal notranslate"><span class="pre">alg</span></code></dt><dd><p>An algorithm identifier (value of type <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a>).</p>
176</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100177</dl>
178<p class="rubric">Returns</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100179<p><code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is a key agreement algorithm, <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise. This macro can return either <code class="docutils literal notranslate"><span class="pre">0</span></code> or <code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is not a supported algorithm identifier.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100180<p class="rubric">Description</p>
181<p>See <a class="reference internal" href="ka.html#key-agreement-algorithms"><span class="secref">Key agreement algorithms</span></a> for a list of defined key agreement algorithms.</p>
182</div>
183<div class="section" id="PSA_ALG_IS_KEY_DERIVATION">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100184<span id="c.PSA_ALG_IS_KEY_DERIVATION"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_IS_KEY_DERIVATION</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100185<p>Whether the specified algorithm is a key derivation algorithm.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100186<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_IS_KEY_DERIVATION" title="PSA_ALG_IS_KEY_DERIVATION">PSA_ALG_IS_KEY_DERIVATION</a>(alg) <em><a class="reference internal" href="../../overview/implementation.html#specification-defined-value"><span class="std std-ref">/* specification-defined value */</span></a></em></pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100187<p class="rubric">Parameters</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100188<dl class="simple">
189<dt> <code class="docutils literal notranslate"><span class="pre">alg</span></code></dt><dd><p>An algorithm identifier (value of type <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a>).</p>
190</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100191</dl>
192<p class="rubric">Returns</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100193<p><code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is a key derivation algorithm, <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise. This macro can return either <code class="docutils literal notranslate"><span class="pre">0</span></code> or <code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is not a supported algorithm identifier.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100194<p class="rubric">Description</p>
195<p>See <a class="reference internal" href="kdf.html#key-derivation-algorithms"><span class="secref">Key derivation algorithms</span></a> for a list of defined key derivation algorithms.</p>
196</div>
197<div class="section" id="PSA_ALG_IS_WILDCARD">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100198<span id="c.PSA_ALG_IS_WILDCARD"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_IS_WILDCARD</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100199<p>Whether the specified algorithm encoding is a wildcard.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100200<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_IS_WILDCARD" title="PSA_ALG_IS_WILDCARD">PSA_ALG_IS_WILDCARD</a>(alg) <em><a class="reference internal" href="../../overview/implementation.html#specification-defined-value"><span class="std std-ref">/* specification-defined value */</span></a></em></pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100201<p class="rubric">Parameters</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100202<dl class="simple">
203<dt> <code class="docutils literal notranslate"><span class="pre">alg</span></code></dt><dd><p>An algorithm identifier (value of type <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a>).</p>
204</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100205</dl>
206<p class="rubric">Returns</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100207<p><code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is a wildcard algorithm encoding.</p>
208<p><code class="docutils literal notranslate"><span class="pre">0</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is a non-wildcard algorithm encoding that is suitable for an operation.</p>
209<p>This macro can return either <code class="docutils literal notranslate"><span class="pre">0</span></code> or <code class="docutils literal notranslate"><span class="pre">1</span></code> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is not a supported algorithm identifier.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100210<p class="rubric">Description</p>
211<p>Wildcard algorithm values can only be used to set the permitted algorithm field in a key policy, wildcard values cannot be used to perform an operation.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100212<p>See <a class="reference internal" href="sign.html#c.PSA_ALG_ANY_HASH" title="PSA_ALG_ANY_HASH"><code class="xref any c c-macro docutils literal notranslate"><span class="pre">PSA_ALG_ANY_HASH</span></code></a> for example of how a wildcard algorithm can be used in a key policy.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100213</div>
214<div class="section" id="PSA_ALG_GET_HASH">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100215<span id="c.PSA_ALG_GET_HASH"></span><h3><code class="docutils literal notranslate"><span class="pre">PSA_ALG_GET_HASH</span></code> (macro)</h3>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100216<p>Get the hash used by a composite algorithm.</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100217<pre class="literal-block">#define <a class="reference internal" href="#c.PSA_ALG_GET_HASH" title="PSA_ALG_GET_HASH">PSA_ALG_GET_HASH</a>(alg) <em><a class="reference internal" href="../../overview/implementation.html#specification-defined-value"><span class="std std-ref">/* specification-defined value */</span></a></em></pre>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100218<p class="rubric">Parameters</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100219<dl class="simple">
220<dt> <code class="docutils literal notranslate"><span class="pre">alg</span></code></dt><dd><p>An algorithm identifier (value of type <a class="reference internal" href="#c.psa_algorithm_t" title="psa_algorithm_t"><code class="xref any c c-type docutils literal notranslate"><span class="pre">psa_algorithm_t</span></code></a>).</p>
221</dd>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100222</dl>
223<p class="rubric">Returns</p>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100224<p>The underlying hash algorithm if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is a composite algorithm that uses a hash algorithm.</p>
225<p><a class="reference internal" href="#c.PSA_ALG_NONE" title="PSA_ALG_NONE"><code class="xref any c c-macro docutils literal notranslate"><span class="pre">PSA_ALG_NONE</span></code></a> if <code class="docutils literal notranslate"><span class="pre">alg</span></code> is not a composite algorithm that uses a hash.</p>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100226<p class="rubric">Description</p>
227<p>The following composite algorithms require a hash algorithm:</p>
228<ul class="simple">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100229<li><p><a class="reference internal" href="sign.html#c.PSA_ALG_ECDSA" title="PSA_ALG_ECDSA"><code class="xref any c c-macro docutils literal notranslate"><span class="pre">PSA_ALG_ECDSA()</span></code></a></p></li>
230<li><p><a class="reference internal" href="kdf.html#c.PSA_ALG_HKDF" title="PSA_ALG_HKDF"><code class="xref any c c-macro docutils literal notranslate"><span class="pre">PSA_ALG_HKDF()</span></code></a></p></li>
231<li><p><a class="reference internal" href="macs.html#c.PSA_ALG_HMAC" title="PSA_ALG_HMAC"><code class="xref any c c-macro docutils literal notranslate"><span class="pre">PSA_ALG_HMAC()</span></code></a></p></li>
232<li><p><a class="reference internal" href="pke.html#c.PSA_ALG_RSA_OAEP" title="PSA_ALG_RSA_OAEP"><code class="xref any c c-macro docutils literal notranslate"><span class="pre">PSA_ALG_RSA_OAEP()</span></code></a></p></li>
233<li><p><a class="reference internal" href="sign.html#c.PSA_ALG_IS_RSA_PKCS1V15_SIGN" title="PSA_ALG_IS_RSA_PKCS1V15_SIGN"><code class="xref any c c-macro docutils literal notranslate"><span class="pre">PSA_ALG_IS_RSA_PKCS1V15_SIGN()</span></code></a></p></li>
234<li><p><a class="reference internal" href="sign.html#c.PSA_ALG_RSA_PSS" title="PSA_ALG_RSA_PSS"><code class="xref any c c-macro docutils literal notranslate"><span class="pre">PSA_ALG_RSA_PSS()</span></code></a></p></li>
235<li><p><a class="reference internal" href="kdf.html#c.PSA_ALG_TLS12_PRF" title="PSA_ALG_TLS12_PRF"><code class="xref any c c-macro docutils literal notranslate"><span class="pre">PSA_ALG_TLS12_PRF()</span></code></a></p></li>
236<li><p><a class="reference internal" href="kdf.html#c.PSA_ALG_TLS12_PSK_TO_MS" title="PSA_ALG_TLS12_PSK_TO_MS"><code class="xref any c c-macro docutils literal notranslate"><span class="pre">PSA_ALG_TLS12_PSK_TO_MS()</span></code></a></p></li>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100237</ul>
238</div>
239</div>
240</div>
241
242
243 </div>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100244
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100245 </div>
246 </div>
247 <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
248 <div class="sphinxsidebarwrapper"><h3><a href="../../index.html"><b>PSA Crypto API</b></a></h3>
249IHI 0086<br/>
250Non-confidential<br/>
251Version 1.0.1
252<span style="color: red; font-weight: bold;"></span>
253<ul>
254<li class="toctree-l1"><a class="reference internal" href="../../about.html">About this document</a></li>
255</ul>
256<ul class="current">
257<li class="toctree-l1"><a class="reference internal" href="../../overview/intro.html">1. Introduction</a></li>
258<li class="toctree-l1"><a class="reference internal" href="../../overview/goals.html">2. Design goals</a></li>
259<li class="toctree-l1"><a class="reference internal" href="../../overview/functionality.html">3. Functionality overview</a></li>
260<li class="toctree-l1"><a class="reference internal" href="../../overview/sample-arch.html">4. Sample architectures</a></li>
261<li class="toctree-l1"><a class="reference internal" href="../../overview/conventions.html">5. Library conventions</a></li>
262<li class="toctree-l1"><a class="reference internal" href="../../overview/implementation.html">6. Implementation considerations</a></li>
263<li class="toctree-l1"><a class="reference internal" href="../../overview/usage.html">7. Usage considerations</a></li>
264<li class="toctree-l1"><a class="reference internal" href="../library/index.html">8. Library management reference</a></li>
265<li class="toctree-l1"><a class="reference internal" href="../keys/index.html">9. Key management reference</a></li>
266<li class="toctree-l1 current"><a class="reference internal" href="index.html">10. Cryptographic operation reference</a><ul class="current">
267<li class="toctree-l2 current"><a class="current reference internal" href="#">10.1. Algorithms</a><ul>
268<li class="toctree-l3"><a class="reference internal" href="#algorithm-encoding">10.1.1. Algorithm encoding</a></li>
269<li class="toctree-l3"><a class="reference internal" href="#algorithm-categories">10.1.2. Algorithm categories</a></li>
270</ul>
271</li>
272<li class="toctree-l2"><a class="reference internal" href="hashes.html">10.2. Message digests</a></li>
273<li class="toctree-l2"><a class="reference internal" href="macs.html">10.3. Message authentication codes (MAC)</a></li>
274<li class="toctree-l2"><a class="reference internal" href="ciphers.html">10.4. Unauthenticated ciphers</a></li>
275<li class="toctree-l2"><a class="reference internal" href="aead.html">10.5. Authenticated encryption with associated data (AEAD)</a></li>
276<li class="toctree-l2"><a class="reference internal" href="kdf.html">10.6. Key derivation</a></li>
277<li class="toctree-l2"><a class="reference internal" href="sign.html">10.7. Asymmetric signature</a></li>
278<li class="toctree-l2"><a class="reference internal" href="pke.html">10.8. Asymmetric encryption</a></li>
279<li class="toctree-l2"><a class="reference internal" href="ka.html">10.9. Key agreement</a></li>
280<li class="toctree-l2"><a class="reference internal" href="rng.html">10.10. Other cryptographic services</a></li>
281</ul>
282</li>
283</ul>
284<ul>
285<li class="toctree-l1"><a class="reference internal" href="../../appendix/example_header.html">Example header file</a></li>
286<li class="toctree-l1"><a class="reference internal" href="../../appendix/specdef_values.html">Example macro implementations</a></li>
287<li class="toctree-l1"><a class="reference internal" href="../../appendix/history.html">Changes to the API</a></li>
288</ul>
289<ul>
290<li class="toctree-l1"><a class="reference internal" href="../../psa_c-identifiers.html">Index of API elements</a></li>
291</ul>
292<div id="searchbox" style="display: none" role="search">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100293 <h3 id="searchlabel">Quick search</h3>
294 <div class="searchformwrapper">
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100295 <form class="search" action="../../search.html" method="get">
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100296 <input type="text" name="q" aria-labelledby="searchlabel" />
297 <input type="submit" value="Go" />
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100298 </form>
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100299 </div>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100300</div>
301<script type="text/javascript">$('#searchbox').show(0);</script>
302 </div>
303 </div>
304 <div class="clearer"></div>
305 </div>
306 <div class="footer">
307 &copy; 2018-2020, Arm Limited or its affiliates. All rights reserved.
308
309 |
Bence Szépkútie26ccad2021-02-01 14:26:11 +0100310 Powered by <a href="http://sphinx-doc.org/">Sphinx 2.1.2</a>
311 &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
Gilles Peskinec2db5f02021-01-18 20:36:53 +0100312
313 </div>
314
315
316
317
318 </body>
319</html>