Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 9e72f3e7ecf68cce016a7c5c59e863d3 > files > 178

lib64polarssl-devel-1.3.8-1.mga4.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>PolarSSL v1.3.8: cipher.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">PolarSSL v1.3.8
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_6a9bbd12bf4e19a18c45e270f8fae3fd.html">include</a></li><li class="navelem"><a class="el" href="dir_04272d44da4745cf8b8bfc767d6c6523.html">polarssl</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">cipher.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Generic cipher wrapper.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="config_8h_source.html">config.h</a>&quot;</code><br/>
<code>#include &lt;string.h&gt;</code><br/>
</div><div class="textblock"><div class="dynheader">
Include dependency graph for cipher.h:</div>
<div class="dyncontent">
<div class="center"><img src="cipher_8h__incl.png" border="0" usemap="#cipher_8h" alt=""/></div>
<map name="cipher_8h" id="cipher_8h">
</map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="cipher_8h__dep__incl.png" border="0" usemap="#cipher_8hdep" alt=""/></div>
<map name="cipher_8hdep" id="cipher_8hdep">
</map>
</div>
</div>
<p><a href="cipher_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcipher__base__t.html">cipher_base_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Base cipher information.  <a href="structcipher__base__t.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcipher__info__t.html">cipher_info_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cipher information.  <a href="structcipher__info__t.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcipher__context__t.html">cipher_context_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic cipher context.  <a href="structcipher__context__t.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a98537bee3c712431f7dce5c154e89164"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a98537bee3c712431f7dce5c154e89164">POLARSSL_CIPHER_MODE_AEAD</a></td></tr>
<tr class="separator:a98537bee3c712431f7dce5c154e89164"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5347e7fd4e1fbf8968317a34dd67bb9d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a5347e7fd4e1fbf8968317a34dd67bb9d">POLARSSL_CIPHER_MODE_WITH_PADDING</a></td></tr>
<tr class="separator:a5347e7fd4e1fbf8968317a34dd67bb9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8625e259f484845e8fe6103f14f14f85"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a8625e259f484845e8fe6103f14f14f85">POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE</a>&#160;&#160;&#160;-0x6080</td></tr>
<tr class="memdesc:a8625e259f484845e8fe6103f14f14f85"><td class="mdescLeft">&#160;</td><td class="mdescRight">The selected feature is not available.  <a href="#a8625e259f484845e8fe6103f14f14f85">More...</a><br/></td></tr>
<tr class="separator:a8625e259f484845e8fe6103f14f14f85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7078656ad138756ee9991f15d529d3bb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a7078656ad138756ee9991f15d529d3bb">POLARSSL_ERR_CIPHER_BAD_INPUT_DATA</a>&#160;&#160;&#160;-0x6100</td></tr>
<tr class="memdesc:a7078656ad138756ee9991f15d529d3bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bad input parameters to function.  <a href="#a7078656ad138756ee9991f15d529d3bb">More...</a><br/></td></tr>
<tr class="separator:a7078656ad138756ee9991f15d529d3bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4d8385421d4fb4a71f2a00734487688"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#ab4d8385421d4fb4a71f2a00734487688">POLARSSL_ERR_CIPHER_ALLOC_FAILED</a>&#160;&#160;&#160;-0x6180</td></tr>
<tr class="memdesc:ab4d8385421d4fb4a71f2a00734487688"><td class="mdescLeft">&#160;</td><td class="mdescRight">Failed to allocate memory.  <a href="#ab4d8385421d4fb4a71f2a00734487688">More...</a><br/></td></tr>
<tr class="separator:ab4d8385421d4fb4a71f2a00734487688"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87777f84d48de3a0d48b252d85c8adc3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a87777f84d48de3a0d48b252d85c8adc3">POLARSSL_ERR_CIPHER_INVALID_PADDING</a>&#160;&#160;&#160;-0x6200</td></tr>
<tr class="memdesc:a87777f84d48de3a0d48b252d85c8adc3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Input data contains invalid padding and is rejected.  <a href="#a87777f84d48de3a0d48b252d85c8adc3">More...</a><br/></td></tr>
<tr class="separator:a87777f84d48de3a0d48b252d85c8adc3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae92e3caeb14ac7b0a3ac63aa49d88e9e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#ae92e3caeb14ac7b0a3ac63aa49d88e9e">POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED</a>&#160;&#160;&#160;-0x6280</td></tr>
<tr class="memdesc:ae92e3caeb14ac7b0a3ac63aa49d88e9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decryption of block requires a full block.  <a href="#ae92e3caeb14ac7b0a3ac63aa49d88e9e">More...</a><br/></td></tr>
<tr class="separator:ae92e3caeb14ac7b0a3ac63aa49d88e9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ed0acc64ce4edbb029dd1d7fd1c8710"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a0ed0acc64ce4edbb029dd1d7fd1c8710">POLARSSL_ERR_CIPHER_AUTH_FAILED</a>&#160;&#160;&#160;-0x6300</td></tr>
<tr class="memdesc:a0ed0acc64ce4edbb029dd1d7fd1c8710"><td class="mdescLeft">&#160;</td><td class="mdescRight">Authentication failed (for AEAD modes).  <a href="#a0ed0acc64ce4edbb029dd1d7fd1c8710">More...</a><br/></td></tr>
<tr class="separator:a0ed0acc64ce4edbb029dd1d7fd1c8710"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1930bcb6327197ff0980aed8bfc3736"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#af1930bcb6327197ff0980aed8bfc3736">POLARSSL_CIPHER_VARIABLE_IV_LEN</a>&#160;&#160;&#160;0x01</td></tr>
<tr class="memdesc:af1930bcb6327197ff0980aed8bfc3736"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cipher accepts IVs of variable length.  <a href="#af1930bcb6327197ff0980aed8bfc3736">More...</a><br/></td></tr>
<tr class="separator:af1930bcb6327197ff0980aed8bfc3736"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49772688b048b1048944402c3429bf41"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a49772688b048b1048944402c3429bf41">POLARSSL_CIPHER_VARIABLE_KEY_LEN</a>&#160;&#160;&#160;0x02</td></tr>
<tr class="memdesc:a49772688b048b1048944402c3429bf41"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cipher accepts keys of variable length.  <a href="#a49772688b048b1048944402c3429bf41">More...</a><br/></td></tr>
<tr class="separator:a49772688b048b1048944402c3429bf41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aded691b9d905920d9675e7b9828a237c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#aded691b9d905920d9675e7b9828a237c">POLARSSL_MAX_IV_LENGTH</a>&#160;&#160;&#160;16</td></tr>
<tr class="memdesc:aded691b9d905920d9675e7b9828a237c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum length of any IV, in bytes.  <a href="#aded691b9d905920d9675e7b9828a237c">More...</a><br/></td></tr>
<tr class="separator:aded691b9d905920d9675e7b9828a237c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2488bd674e8deee5938b1926f4868f0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#aa2488bd674e8deee5938b1926f4868f0">POLARSSL_MAX_BLOCK_LENGTH</a>&#160;&#160;&#160;16</td></tr>
<tr class="memdesc:aa2488bd674e8deee5938b1926f4868f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum block size of any cipher, in bytes.  <a href="#aa2488bd674e8deee5938b1926f4868f0">More...</a><br/></td></tr>
<tr class="separator:aa2488bd674e8deee5938b1926f4868f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a373f5d3a0a42c77ff4f5fe4fe7da0560"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560">cipher_id_t</a> { <br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560a18bc87fe56e4f9fcb83c2a59829915d8">POLARSSL_CIPHER_ID_NONE</a> = 0, 
<a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560aad5ebb9bbbb1a70f117da429c31f1850">POLARSSL_CIPHER_ID_NULL</a>, 
<a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560a7f2185b07190a2ea88e864155bbec21d">POLARSSL_CIPHER_ID_AES</a>, 
<a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560a54c7640a78cff246c1c9557d23ff5fa6">POLARSSL_CIPHER_ID_DES</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560a945e095b835040add01d72e8a24e0047">POLARSSL_CIPHER_ID_3DES</a>, 
<a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560a4e4271ec0a459bae7d6f4a0a825bddc9">POLARSSL_CIPHER_ID_CAMELLIA</a>, 
<a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560a4156bba2b3f3f98a5ef5ee212a6ce992">POLARSSL_CIPHER_ID_BLOWFISH</a>, 
<a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560a3c1f6cf1191ddfb115467769ddff4851">POLARSSL_CIPHER_ID_ARC4</a>
<br/>
 }</td></tr>
<tr class="separator:a373f5d3a0a42c77ff4f5fe4fe7da0560"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a806c82ed7e8b591dedc86093f38274e6"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6">cipher_type_t</a> { <br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6af46e4d5256f808678490a13ab72c1006">POLARSSL_CIPHER_NONE</a> = 0, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a26b732304711bc77fbd4984f59719461">POLARSSL_CIPHER_NULL</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a425c63dfadae3b8dd2eea5cad19832ab">POLARSSL_CIPHER_AES_128_ECB</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6adef0dc398d25e9e354ec08c64066f8e7">POLARSSL_CIPHER_AES_192_ECB</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6adb00f9e0c03029ce6536979ba41fe1a5">POLARSSL_CIPHER_AES_256_ECB</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a8d4e003be055910575927334574d81e2">POLARSSL_CIPHER_AES_128_CBC</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6adf8f7062a1324652e90eedd7d986a15a">POLARSSL_CIPHER_AES_192_CBC</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a383bff04387b7fbb14fdf526688a87c4">POLARSSL_CIPHER_AES_256_CBC</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a7f02d410ddbed8cf2d14900cf3574409">POLARSSL_CIPHER_AES_128_CFB128</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6aad917e3c424e563fc088827959c88868">POLARSSL_CIPHER_AES_192_CFB128</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a69e28d61d887dea757badae6bb5cc1c5">POLARSSL_CIPHER_AES_256_CFB128</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a76fa4f3edfc079d0d9e40356d5827c7b">POLARSSL_CIPHER_AES_128_CTR</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a5aca9e36e3bf9a29724bd867dfc7550f">POLARSSL_CIPHER_AES_192_CTR</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6abaeb5cf2ebe24189a042f999151468ae">POLARSSL_CIPHER_AES_256_CTR</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a2d0bc2d755adbd6dba51be94893e296d">POLARSSL_CIPHER_AES_128_GCM</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a916a07fd9b1787be9f9bf4d55e92a2a8">POLARSSL_CIPHER_AES_192_GCM</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a5113b084db48bacfe7f8773a8f709a30">POLARSSL_CIPHER_AES_256_GCM</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6afb71c594cdaf3411cf7768ff57431125">POLARSSL_CIPHER_CAMELLIA_128_ECB</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a971ae82c98df3922c99ac98983cf3a86">POLARSSL_CIPHER_CAMELLIA_192_ECB</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a89d049ae306bffa6d89431b51c8a786b">POLARSSL_CIPHER_CAMELLIA_256_ECB</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a7fbc06c11043b1283a2f0c37063025ef">POLARSSL_CIPHER_CAMELLIA_128_CBC</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a25d8a914e19a95d2f95ecb764058d49c">POLARSSL_CIPHER_CAMELLIA_192_CBC</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6ad1b4dfdab416de3a5e384e13d622a7a6">POLARSSL_CIPHER_CAMELLIA_256_CBC</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a8193cb4f12803423fc303f3f804038a4">POLARSSL_CIPHER_CAMELLIA_128_CFB128</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a9924eac692478f079e815869556553d2">POLARSSL_CIPHER_CAMELLIA_192_CFB128</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a634d2a1fff658d083c07a21175ca6c8e">POLARSSL_CIPHER_CAMELLIA_256_CFB128</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a771ce38dd356f676da95c91c86ac3b2d">POLARSSL_CIPHER_CAMELLIA_128_CTR</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a8ff89c9e9e41ec779b9424f51bfa2fba">POLARSSL_CIPHER_CAMELLIA_192_CTR</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a25905ecd711ed8af6d78bd38b19790de">POLARSSL_CIPHER_CAMELLIA_256_CTR</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a4802ed2b8f0b2201a35bbee4779ca40b">POLARSSL_CIPHER_CAMELLIA_128_GCM</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a8355e93505e089dbe9fb391e901d6d44">POLARSSL_CIPHER_CAMELLIA_192_GCM</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a028f9f32aacd390889b29f67c6d9fdcd">POLARSSL_CIPHER_CAMELLIA_256_GCM</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a14e0f405590439261729bac7ed0be6d4">POLARSSL_CIPHER_DES_ECB</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6af14528a0b54195461babbaec8181913c">POLARSSL_CIPHER_DES_CBC</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a148083389736dc34ee2d729515482d85">POLARSSL_CIPHER_DES_EDE_ECB</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a8ce984017149df219b49fcc1d506ce10">POLARSSL_CIPHER_DES_EDE_CBC</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a79352d8566dcb0eb1395d0f4ce4ba0b2">POLARSSL_CIPHER_DES_EDE3_ECB</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6ae6ab208bff4f88dbba3277a05686b0a9">POLARSSL_CIPHER_DES_EDE3_CBC</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6ade30c0ba8f3b4c0149dc711f595c32a9">POLARSSL_CIPHER_BLOWFISH_ECB</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a38daa50cfa1c23ffda451ea940474a3f">POLARSSL_CIPHER_BLOWFISH_CBC</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6ad678b6ae83820aaa338fdd8a9888904d">POLARSSL_CIPHER_BLOWFISH_CFB64</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a0da001217dca5276686d3fe73939bb77">POLARSSL_CIPHER_BLOWFISH_CTR</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6ab7f25ac8ae942ca9cfbe97a65d56ce2e">POLARSSL_CIPHER_ARC4_128</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6ab613ba7e4b52c0cdc64e93d314cd3fbf">POLARSSL_CIPHER_AES_128_CCM</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6ab62b45d44176c1c74d0894f1245268ae">POLARSSL_CIPHER_AES_192_CCM</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a2c83917c06819e0159c46d081beeed85">POLARSSL_CIPHER_AES_256_CCM</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a2c9c1dabfa8c03b612dd7064fedc6540">POLARSSL_CIPHER_CAMELLIA_128_CCM</a>, 
<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a17e4803d634ea1ee4daa8f26500a6393">POLARSSL_CIPHER_CAMELLIA_192_CCM</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6a80290044d0da4521376ed60d5edc8c67">POLARSSL_CIPHER_CAMELLIA_256_CCM</a>
<br/>
 }</td></tr>
<tr class="separator:a806c82ed7e8b591dedc86093f38274e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af65d0bd9b5c3504fd010cf54955b179c"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179c">cipher_mode_t</a> { <br/>
&#160;&#160;<a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179ca12481621829a56c22c4620d5596feca5">POLARSSL_MODE_NONE</a> = 0, 
<a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179caaefd6ed34c1992d638129e161b28084a">POLARSSL_MODE_ECB</a>, 
<a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179cabc642c3486ec5224ef3c13e53fc941d0">POLARSSL_MODE_CBC</a>, 
<a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179cafea74e56f89fafd334db1f5cb850e913">POLARSSL_MODE_CFB</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179caa04d33ad2e38d6ef6996cd00c0e55730">POLARSSL_MODE_OFB</a>, 
<a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179ca9c7b9959c0a1b08bed57d40edc27ffe9">POLARSSL_MODE_CTR</a>, 
<a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179ca45d7a269317fef5880d5ae9c6dae13f9">POLARSSL_MODE_GCM</a>, 
<a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179caf460bee5fb0bf8b383a1fe23099b6707">POLARSSL_MODE_STREAM</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179cabf517e1e6d97cc0b58ae154f5a2a1265">POLARSSL_MODE_CCM</a>
<br/>
 }</td></tr>
<tr class="separator:af65d0bd9b5c3504fd010cf54955b179c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb17eb5d2106ba020a20b70d878aa7dd"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#acb17eb5d2106ba020a20b70d878aa7dd">cipher_padding_t</a> { <br/>
&#160;&#160;<a class="el" href="cipher_8h.html#acb17eb5d2106ba020a20b70d878aa7dda4a67d6bf4aec45912ee66f37a3cbb8a8">POLARSSL_PADDING_PKCS7</a> = 0, 
<a class="el" href="cipher_8h.html#acb17eb5d2106ba020a20b70d878aa7dda1500b0293a75a29cef21ea91ca279edc">POLARSSL_PADDING_ONE_AND_ZEROS</a>, 
<a class="el" href="cipher_8h.html#acb17eb5d2106ba020a20b70d878aa7dda5610144cf3e2bf2289e0e52e3fe16aa2">POLARSSL_PADDING_ZEROS_AND_LEN</a>, 
<a class="el" href="cipher_8h.html#acb17eb5d2106ba020a20b70d878aa7ddadba7dd52d3452542bba0d1391301b7d6">POLARSSL_PADDING_ZEROS</a>, 
<br/>
&#160;&#160;<a class="el" href="cipher_8h.html#acb17eb5d2106ba020a20b70d878aa7ddaae558f0b4d848f4a29f0fae3fedbcf99">POLARSSL_PADDING_NONE</a>
<br/>
 }</td></tr>
<tr class="separator:acb17eb5d2106ba020a20b70d878aa7dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76a810650461f2062938ee9b82666b36"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a76a810650461f2062938ee9b82666b36">operation_t</a> { <a class="el" href="cipher_8h.html#a76a810650461f2062938ee9b82666b36a878b38bff48702f7816ee15e6954b717">POLARSSL_OPERATION_NONE</a> = -1, 
<a class="el" href="cipher_8h.html#a76a810650461f2062938ee9b82666b36ae99cd4d55b496dbb74727f7a6ed872c7">POLARSSL_DECRYPT</a> = 0, 
<a class="el" href="cipher_8h.html#a76a810650461f2062938ee9b82666b36ad8e41c0d381b23d7835dd322e511564f">POLARSSL_ENCRYPT</a>
 }</td></tr>
<tr class="separator:a76a810650461f2062938ee9b82666b36"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06fc87d81c62e9abb8790b6e5713c55b"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <a class="el" href="cipher_8h.html#a06fc87d81c62e9abb8790b6e5713c55badc72f57d8ab7a6ca11f7cf86c6899366">POLARSSL_KEY_LENGTH_NONE</a> = 0, 
<a class="el" href="cipher_8h.html#a06fc87d81c62e9abb8790b6e5713c55ba47ee3dc5200730a429c1ec172e7d3a9d">POLARSSL_KEY_LENGTH_DES</a> = 64, 
<a class="el" href="cipher_8h.html#a06fc87d81c62e9abb8790b6e5713c55bac20e9716bcdadc5bddba0e6e6ebb133b">POLARSSL_KEY_LENGTH_DES_EDE</a> = 128, 
<a class="el" href="cipher_8h.html#a06fc87d81c62e9abb8790b6e5713c55bae76d012453101c4c2abe7a807de47219">POLARSSL_KEY_LENGTH_DES_EDE3</a> = 192
 }</td></tr>
<tr class="separator:a06fc87d81c62e9abb8790b6e5713c55b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a036719c5224e57cf8469ebf9daceb137"><td class="memItemLeft" align="right" valign="top">const int *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a036719c5224e57cf8469ebf9daceb137">cipher_list</a> (void)</td></tr>
<tr class="memdesc:a036719c5224e57cf8469ebf9daceb137"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the list of ciphers supported by the generic cipher module.  <a href="#a036719c5224e57cf8469ebf9daceb137">More...</a><br/></td></tr>
<tr class="separator:a036719c5224e57cf8469ebf9daceb137"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76763329d5579d862dfca01adf32c05b"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structcipher__info__t.html">cipher_info_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a76763329d5579d862dfca01adf32c05b">cipher_info_from_string</a> (const char *cipher_name)</td></tr>
<tr class="memdesc:a76763329d5579d862dfca01adf32c05b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the cipher information structure associated with the given cipher name.  <a href="#a76763329d5579d862dfca01adf32c05b">More...</a><br/></td></tr>
<tr class="separator:a76763329d5579d862dfca01adf32c05b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a6dfa43a6758eb075dd2eb86b538900"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structcipher__info__t.html">cipher_info_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a1a6dfa43a6758eb075dd2eb86b538900">cipher_info_from_type</a> (const <a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6">cipher_type_t</a> cipher_type)</td></tr>
<tr class="memdesc:a1a6dfa43a6758eb075dd2eb86b538900"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the cipher information structure associated with the given cipher type.  <a href="#a1a6dfa43a6758eb075dd2eb86b538900">More...</a><br/></td></tr>
<tr class="separator:a1a6dfa43a6758eb075dd2eb86b538900"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68fd6a4ea2c236dc4abcad76d73d5cac"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structcipher__info__t.html">cipher_info_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a68fd6a4ea2c236dc4abcad76d73d5cac">cipher_info_from_values</a> (const <a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560">cipher_id_t</a> cipher_id, int key_length, const <a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179c">cipher_mode_t</a> mode)</td></tr>
<tr class="memdesc:a68fd6a4ea2c236dc4abcad76d73d5cac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the cipher information structure associated with the given cipher id, key size and mode.  <a href="#a68fd6a4ea2c236dc4abcad76d73d5cac">More...</a><br/></td></tr>
<tr class="separator:a68fd6a4ea2c236dc4abcad76d73d5cac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a719708dc3b2f0d0e7beadccf871f4f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a6a719708dc3b2f0d0e7beadccf871f4f">cipher_init</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:a6a719708dc3b2f0d0e7beadccf871f4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize a cipher_context (as NONE)  <a href="#a6a719708dc3b2f0d0e7beadccf871f4f">More...</a><br/></td></tr>
<tr class="separator:a6a719708dc3b2f0d0e7beadccf871f4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af27f8e4cd1fab59615c3d73c69d136c8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#af27f8e4cd1fab59615c3d73c69d136c8">cipher_free</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:af27f8e4cd1fab59615c3d73c69d136c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free and clear the cipher-specific context of ctx.  <a href="#af27f8e4cd1fab59615c3d73c69d136c8">More...</a><br/></td></tr>
<tr class="separator:af27f8e4cd1fab59615c3d73c69d136c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc7c37e925193805884085ca87587f64"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#adc7c37e925193805884085ca87587f64">cipher_init_ctx</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, const <a class="el" href="structcipher__info__t.html">cipher_info_t</a> *cipher_info)</td></tr>
<tr class="memdesc:adc7c37e925193805884085ca87587f64"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialises and fills the cipher context structure with the appropriate values.  <a href="#adc7c37e925193805884085ca87587f64">More...</a><br/></td></tr>
<tr class="separator:adc7c37e925193805884085ca87587f64"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8abe3c96c800481697cfe8260cf829d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#ac8abe3c96c800481697cfe8260cf829d">cipher_free_ctx</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:ac8abe3c96c800481697cfe8260cf829d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free the cipher-specific context of ctx.  <a href="#ac8abe3c96c800481697cfe8260cf829d">More...</a><br/></td></tr>
<tr class="separator:ac8abe3c96c800481697cfe8260cf829d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3ffcee4725c03638726f7211b31bcb7"><td class="memItemLeft" align="right" valign="top">static unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#ac3ffcee4725c03638726f7211b31bcb7">cipher_get_block_size</a> (const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:ac3ffcee4725c03638726f7211b31bcb7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the block size of the given cipher.  <a href="#ac3ffcee4725c03638726f7211b31bcb7">More...</a><br/></td></tr>
<tr class="separator:ac3ffcee4725c03638726f7211b31bcb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8cc9566954343cc25ab4432db0c3a353"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179c">cipher_mode_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a8cc9566954343cc25ab4432db0c3a353">cipher_get_cipher_mode</a> (const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:a8cc9566954343cc25ab4432db0c3a353"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the mode of operation for the cipher.  <a href="#a8cc9566954343cc25ab4432db0c3a353">More...</a><br/></td></tr>
<tr class="separator:a8cc9566954343cc25ab4432db0c3a353"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0555cab5391282ebcb61a899c00addec"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a0555cab5391282ebcb61a899c00addec">cipher_get_iv_size</a> (const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:a0555cab5391282ebcb61a899c00addec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the size of the cipher's IV/NONCE in bytes.  <a href="#a0555cab5391282ebcb61a899c00addec">More...</a><br/></td></tr>
<tr class="separator:a0555cab5391282ebcb61a899c00addec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07c79d24f8381fade8fcad38b8351f79"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6">cipher_type_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a07c79d24f8381fade8fcad38b8351f79">cipher_get_type</a> (const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:a07c79d24f8381fade8fcad38b8351f79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the type of the given cipher.  <a href="#a07c79d24f8381fade8fcad38b8351f79">More...</a><br/></td></tr>
<tr class="separator:a07c79d24f8381fade8fcad38b8351f79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab13b86afbee6e045811edf5601dc5ce5"><td class="memItemLeft" align="right" valign="top">static const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#ab13b86afbee6e045811edf5601dc5ce5">cipher_get_name</a> (const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:ab13b86afbee6e045811edf5601dc5ce5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the name of the given cipher, as a string.  <a href="#ab13b86afbee6e045811edf5601dc5ce5">More...</a><br/></td></tr>
<tr class="separator:ab13b86afbee6e045811edf5601dc5ce5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9534326eea78885a9b47ce0b0a3aa0d3"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a9534326eea78885a9b47ce0b0a3aa0d3">cipher_get_key_size</a> (const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:a9534326eea78885a9b47ce0b0a3aa0d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the key length of the cipher.  <a href="#a9534326eea78885a9b47ce0b0a3aa0d3">More...</a><br/></td></tr>
<tr class="separator:a9534326eea78885a9b47ce0b0a3aa0d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6316d711155a6ba661d6dd18eaf3bf2"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="cipher_8h.html#a76a810650461f2062938ee9b82666b36">operation_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#ab6316d711155a6ba661d6dd18eaf3bf2">cipher_get_operation</a> (const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:ab6316d711155a6ba661d6dd18eaf3bf2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the operation of the given cipher.  <a href="#ab6316d711155a6ba661d6dd18eaf3bf2">More...</a><br/></td></tr>
<tr class="separator:ab6316d711155a6ba661d6dd18eaf3bf2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77355bddf2d69f68d55e2bd2374e9257"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a77355bddf2d69f68d55e2bd2374e9257">cipher_setkey</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, const unsigned char *key, int key_length, const <a class="el" href="cipher_8h.html#a76a810650461f2062938ee9b82666b36">operation_t</a> operation)</td></tr>
<tr class="memdesc:a77355bddf2d69f68d55e2bd2374e9257"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the key to use with the given context.  <a href="#a77355bddf2d69f68d55e2bd2374e9257">More...</a><br/></td></tr>
<tr class="separator:a77355bddf2d69f68d55e2bd2374e9257"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbc809fe32e1cce35834006d1edf1f2c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#abbc809fe32e1cce35834006d1edf1f2c">cipher_set_padding_mode</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, <a class="el" href="cipher_8h.html#acb17eb5d2106ba020a20b70d878aa7dd">cipher_padding_t</a> mode)</td></tr>
<tr class="memdesc:abbc809fe32e1cce35834006d1edf1f2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set padding mode, for cipher modes that use padding.  <a href="#abbc809fe32e1cce35834006d1edf1f2c">More...</a><br/></td></tr>
<tr class="separator:abbc809fe32e1cce35834006d1edf1f2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abca5954bfff4e62c5280267d2a97171d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#abca5954bfff4e62c5280267d2a97171d">cipher_set_iv</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, const unsigned char *iv, size_t iv_len)</td></tr>
<tr class="memdesc:abca5954bfff4e62c5280267d2a97171d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the initialization vector (IV) or nonce.  <a href="#abca5954bfff4e62c5280267d2a97171d">More...</a><br/></td></tr>
<tr class="separator:abca5954bfff4e62c5280267d2a97171d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a55a8eeae5ebb2627c59257ffb202bc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a0a55a8eeae5ebb2627c59257ffb202bc">cipher_reset</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx)</td></tr>
<tr class="memdesc:a0a55a8eeae5ebb2627c59257ffb202bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finish preparation of the given context.  <a href="#a0a55a8eeae5ebb2627c59257ffb202bc">More...</a><br/></td></tr>
<tr class="separator:a0a55a8eeae5ebb2627c59257ffb202bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b8cb1cff4b19e01849c84c67364500d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a5b8cb1cff4b19e01849c84c67364500d">cipher_update_ad</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, const unsigned char *ad, size_t ad_len)</td></tr>
<tr class="memdesc:a5b8cb1cff4b19e01849c84c67364500d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add additional data (for AEAD ciphers).  <a href="#a5b8cb1cff4b19e01849c84c67364500d">More...</a><br/></td></tr>
<tr class="separator:a5b8cb1cff4b19e01849c84c67364500d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afca62e9b6e95da3a46fa6c95f0a09e38"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#afca62e9b6e95da3a46fa6c95f0a09e38">cipher_update</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen)</td></tr>
<tr class="memdesc:afca62e9b6e95da3a46fa6c95f0a09e38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic cipher update function.  <a href="#afca62e9b6e95da3a46fa6c95f0a09e38">More...</a><br/></td></tr>
<tr class="separator:afca62e9b6e95da3a46fa6c95f0a09e38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12a036b9caa428f47dfb14c06753f14c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a12a036b9caa428f47dfb14c06753f14c">cipher_finish</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, unsigned char *output, size_t *olen)</td></tr>
<tr class="memdesc:a12a036b9caa428f47dfb14c06753f14c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic cipher finalisation function.  <a href="#a12a036b9caa428f47dfb14c06753f14c">More...</a><br/></td></tr>
<tr class="separator:a12a036b9caa428f47dfb14c06753f14c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54a922d31e506aa36dd8ed7798ed2a41"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a54a922d31e506aa36dd8ed7798ed2a41">cipher_write_tag</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, unsigned char *tag, size_t tag_len)</td></tr>
<tr class="memdesc:a54a922d31e506aa36dd8ed7798ed2a41"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write tag for AEAD ciphers.  <a href="#a54a922d31e506aa36dd8ed7798ed2a41">More...</a><br/></td></tr>
<tr class="separator:a54a922d31e506aa36dd8ed7798ed2a41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a907de4e9c5331d3e0a7d58c887e9173a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a907de4e9c5331d3e0a7d58c887e9173a">cipher_check_tag</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, const unsigned char *tag, size_t tag_len)</td></tr>
<tr class="memdesc:a907de4e9c5331d3e0a7d58c887e9173a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check tag for AEAD ciphers.  <a href="#a907de4e9c5331d3e0a7d58c887e9173a">More...</a><br/></td></tr>
<tr class="separator:a907de4e9c5331d3e0a7d58c887e9173a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac61499800e5f1436c61fcdd8be5ba4b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#aac61499800e5f1436c61fcdd8be5ba4b">cipher_crypt</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, const unsigned char *iv, size_t iv_len, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen)</td></tr>
<tr class="memdesc:aac61499800e5f1436c61fcdd8be5ba4b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic all-in-one encryption/decryption (for all ciphers except AEAD constructs).  <a href="#aac61499800e5f1436c61fcdd8be5ba4b">More...</a><br/></td></tr>
<tr class="separator:aac61499800e5f1436c61fcdd8be5ba4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30155c676722d3538392b32ac45e8f8a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#a30155c676722d3538392b32ac45e8f8a">cipher_auth_encrypt</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, const unsigned char *iv, size_t iv_len, const unsigned char *ad, size_t ad_len, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen, unsigned char *tag, size_t tag_len)</td></tr>
<tr class="memdesc:a30155c676722d3538392b32ac45e8f8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic autenticated encryption (AEAD ciphers).  <a href="#a30155c676722d3538392b32ac45e8f8a">More...</a><br/></td></tr>
<tr class="separator:a30155c676722d3538392b32ac45e8f8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2f7c44697223ae63d7814fc7e8b9092"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#ad2f7c44697223ae63d7814fc7e8b9092">cipher_auth_decrypt</a> (<a class="el" href="structcipher__context__t.html">cipher_context_t</a> *ctx, const unsigned char *iv, size_t iv_len, const unsigned char *ad, size_t ad_len, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen, const unsigned char *tag, size_t tag_len)</td></tr>
<tr class="memdesc:ad2f7c44697223ae63d7814fc7e8b9092"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic autenticated decryption (AEAD ciphers).  <a href="#ad2f7c44697223ae63d7814fc7e8b9092">More...</a><br/></td></tr>
<tr class="separator:ad2f7c44697223ae63d7814fc7e8b9092"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9adb04c9894c75bbf71189d25b1b988"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cipher_8h.html#ae9adb04c9894c75bbf71189d25b1b988">cipher_self_test</a> (int verbose)</td></tr>
<tr class="memdesc:ae9adb04c9894c75bbf71189d25b1b988"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checkup routine.  <a href="#ae9adb04c9894c75bbf71189d25b1b988">More...</a><br/></td></tr>
<tr class="separator:ae9adb04c9894c75bbf71189d25b1b988"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Generic cipher wrapper. </p>
<dl class="section author"><dt>Author</dt><dd>Adriaan de Jong <a href="#" onclick="location.href='mai'+'lto:'+'dej'+'on'+'g@f'+'ox'+'-it'+'.c'+'om'; return false;">dejon<span style="display: none;">.nosp@m.</span>g@fo<span style="display: none;">.nosp@m.</span>x-it.<span style="display: none;">.nosp@m.</span>com</a></dd></dl>
<p>Copyright (C) 2006-2014, Brainspark B.V.</p>
<p>This file is part of PolarSSL (<a href="http://www.polarssl.org">http://www.polarssl.org</a>) Lead Maintainer: Paul Bakker &lt;polarssl_maintainer at polarssl.org&gt;</p>
<p>All rights reserved.</p>
<p>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. </p>

<p>Definition in file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a98537bee3c712431f7dce5c154e89164"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_CIPHER_MODE_AEAD</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00040">40</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5347e7fd4e1fbf8968317a34dd67bb9d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_CIPHER_MODE_WITH_PADDING</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00044">44</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="af1930bcb6327197ff0980aed8bfc3736"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_CIPHER_VARIABLE_IV_LEN&#160;&#160;&#160;0x01</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Cipher accepts IVs of variable length. </p>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00064">64</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="a49772688b048b1048944402c3429bf41"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_CIPHER_VARIABLE_KEY_LEN&#160;&#160;&#160;0x02</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Cipher accepts keys of variable length. </p>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00065">65</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab4d8385421d4fb4a71f2a00734487688"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_ERR_CIPHER_ALLOC_FAILED&#160;&#160;&#160;-0x6180</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Failed to allocate memory. </p>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00059">59</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="a0ed0acc64ce4edbb029dd1d7fd1c8710"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_ERR_CIPHER_AUTH_FAILED&#160;&#160;&#160;-0x6300</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Authentication failed (for AEAD modes). </p>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00062">62</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="a7078656ad138756ee9991f15d529d3bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_ERR_CIPHER_BAD_INPUT_DATA&#160;&#160;&#160;-0x6100</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bad input parameters to function. </p>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00058">58</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="a8625e259f484845e8fe6103f14f14f85"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE&#160;&#160;&#160;-0x6080</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The selected feature is not available. </p>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00057">57</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="ae92e3caeb14ac7b0a3ac63aa49d88e9e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED&#160;&#160;&#160;-0x6280</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decryption of block requires a full block. </p>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00061">61</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="a87777f84d48de3a0d48b252d85c8adc3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_ERR_CIPHER_INVALID_PADDING&#160;&#160;&#160;-0x6200</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Input data contains invalid padding and is rejected. </p>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00060">60</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa2488bd674e8deee5938b1926f4868f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_MAX_BLOCK_LENGTH&#160;&#160;&#160;16</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Maximum block size of any cipher, in bytes. </p>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00174">174</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="aded691b9d905920d9675e7b9828a237c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define POLARSSL_MAX_IV_LENGTH&#160;&#160;&#160;16</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Maximum length of any IV, in bytes. </p>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00172">172</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="a06fc87d81c62e9abb8790b6e5713c55b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a06fc87d81c62e9abb8790b6e5713c55badc72f57d8ab7a6ca11f7cf86c6899366"></a>POLARSSL_KEY_LENGTH_NONE</em>&nbsp;</td><td class="fielddoc">
<p>Undefined key length. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a06fc87d81c62e9abb8790b6e5713c55ba47ee3dc5200730a429c1ec172e7d3a9d"></a>POLARSSL_KEY_LENGTH_DES</em>&nbsp;</td><td class="fielddoc">
<p>Key length, in bits (including parity), for DES keys. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a06fc87d81c62e9abb8790b6e5713c55bac20e9716bcdadc5bddba0e6e6ebb133b"></a>POLARSSL_KEY_LENGTH_DES_EDE</em>&nbsp;</td><td class="fielddoc">
<p>Key length, in bits (including parity), for DES in two key EDE. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a06fc87d81c62e9abb8790b6e5713c55bae76d012453101c4c2abe7a807de47219"></a>POLARSSL_KEY_LENGTH_DES_EDE3</em>&nbsp;</td><td class="fielddoc">
<p>Key length, in bits (including parity), for DES in three-key EDE. </p>
</td></tr>
</table>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00160">160</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="a373f5d3a0a42c77ff4f5fe4fe7da0560"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560">cipher_id_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a373f5d3a0a42c77ff4f5fe4fe7da0560a18bc87fe56e4f9fcb83c2a59829915d8"></a>POLARSSL_CIPHER_ID_NONE</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a373f5d3a0a42c77ff4f5fe4fe7da0560aad5ebb9bbbb1a70f117da429c31f1850"></a>POLARSSL_CIPHER_ID_NULL</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a373f5d3a0a42c77ff4f5fe4fe7da0560a7f2185b07190a2ea88e864155bbec21d"></a>POLARSSL_CIPHER_ID_AES</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a373f5d3a0a42c77ff4f5fe4fe7da0560a54c7640a78cff246c1c9557d23ff5fa6"></a>POLARSSL_CIPHER_ID_DES</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a373f5d3a0a42c77ff4f5fe4fe7da0560a945e095b835040add01d72e8a24e0047"></a>POLARSSL_CIPHER_ID_3DES</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a373f5d3a0a42c77ff4f5fe4fe7da0560a4e4271ec0a459bae7d6f4a0a825bddc9"></a>POLARSSL_CIPHER_ID_CAMELLIA</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a373f5d3a0a42c77ff4f5fe4fe7da0560a4156bba2b3f3f98a5ef5ee212a6ce992"></a>POLARSSL_CIPHER_ID_BLOWFISH</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a373f5d3a0a42c77ff4f5fe4fe7da0560a3c1f6cf1191ddfb115467769ddff4851"></a>POLARSSL_CIPHER_ID_ARC4</em>&nbsp;</td><td class="fielddoc">
</td></tr>
</table>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00071">71</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="af65d0bd9b5c3504fd010cf54955b179c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179c">cipher_mode_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="af65d0bd9b5c3504fd010cf54955b179ca12481621829a56c22c4620d5596feca5"></a>POLARSSL_MODE_NONE</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="af65d0bd9b5c3504fd010cf54955b179caaefd6ed34c1992d638129e161b28084a"></a>POLARSSL_MODE_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="af65d0bd9b5c3504fd010cf54955b179cabc642c3486ec5224ef3c13e53fc941d0"></a>POLARSSL_MODE_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="af65d0bd9b5c3504fd010cf54955b179cafea74e56f89fafd334db1f5cb850e913"></a>POLARSSL_MODE_CFB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="af65d0bd9b5c3504fd010cf54955b179caa04d33ad2e38d6ef6996cd00c0e55730"></a>POLARSSL_MODE_OFB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="af65d0bd9b5c3504fd010cf54955b179ca9c7b9959c0a1b08bed57d40edc27ffe9"></a>POLARSSL_MODE_CTR</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="af65d0bd9b5c3504fd010cf54955b179ca45d7a269317fef5880d5ae9c6dae13f9"></a>POLARSSL_MODE_GCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="af65d0bd9b5c3504fd010cf54955b179caf460bee5fb0bf8b383a1fe23099b6707"></a>POLARSSL_MODE_STREAM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="af65d0bd9b5c3504fd010cf54955b179cabf517e1e6d97cc0b58ae154f5a2a1265"></a>POLARSSL_MODE_CCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
</table>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00134">134</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="acb17eb5d2106ba020a20b70d878aa7dd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="cipher_8h.html#acb17eb5d2106ba020a20b70d878aa7dd">cipher_padding_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="acb17eb5d2106ba020a20b70d878aa7dda4a67d6bf4aec45912ee66f37a3cbb8a8"></a>POLARSSL_PADDING_PKCS7</em>&nbsp;</td><td class="fielddoc">
<p>PKCS7 padding (default) </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="acb17eb5d2106ba020a20b70d878aa7dda1500b0293a75a29cef21ea91ca279edc"></a>POLARSSL_PADDING_ONE_AND_ZEROS</em>&nbsp;</td><td class="fielddoc">
<p>ISO/IEC 7816-4 padding. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="acb17eb5d2106ba020a20b70d878aa7dda5610144cf3e2bf2289e0e52e3fe16aa2"></a>POLARSSL_PADDING_ZEROS_AND_LEN</em>&nbsp;</td><td class="fielddoc">
<p>ANSI X.923 padding. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="acb17eb5d2106ba020a20b70d878aa7ddadba7dd52d3452542bba0d1391301b7d6"></a>POLARSSL_PADDING_ZEROS</em>&nbsp;</td><td class="fielddoc">
<p>zero padding (not reversible!) </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="acb17eb5d2106ba020a20b70d878aa7ddaae558f0b4d848f4a29f0fae3fedbcf99"></a>POLARSSL_PADDING_NONE</em>&nbsp;</td><td class="fielddoc">
<p>never pad (full blocks only) </p>
</td></tr>
</table>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00146">146</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6">cipher_type_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6af46e4d5256f808678490a13ab72c1006"></a>POLARSSL_CIPHER_NONE</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a26b732304711bc77fbd4984f59719461"></a>POLARSSL_CIPHER_NULL</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a425c63dfadae3b8dd2eea5cad19832ab"></a>POLARSSL_CIPHER_AES_128_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6adef0dc398d25e9e354ec08c64066f8e7"></a>POLARSSL_CIPHER_AES_192_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6adb00f9e0c03029ce6536979ba41fe1a5"></a>POLARSSL_CIPHER_AES_256_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a8d4e003be055910575927334574d81e2"></a>POLARSSL_CIPHER_AES_128_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6adf8f7062a1324652e90eedd7d986a15a"></a>POLARSSL_CIPHER_AES_192_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a383bff04387b7fbb14fdf526688a87c4"></a>POLARSSL_CIPHER_AES_256_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a7f02d410ddbed8cf2d14900cf3574409"></a>POLARSSL_CIPHER_AES_128_CFB128</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6aad917e3c424e563fc088827959c88868"></a>POLARSSL_CIPHER_AES_192_CFB128</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a69e28d61d887dea757badae6bb5cc1c5"></a>POLARSSL_CIPHER_AES_256_CFB128</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a76fa4f3edfc079d0d9e40356d5827c7b"></a>POLARSSL_CIPHER_AES_128_CTR</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a5aca9e36e3bf9a29724bd867dfc7550f"></a>POLARSSL_CIPHER_AES_192_CTR</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6abaeb5cf2ebe24189a042f999151468ae"></a>POLARSSL_CIPHER_AES_256_CTR</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a2d0bc2d755adbd6dba51be94893e296d"></a>POLARSSL_CIPHER_AES_128_GCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a916a07fd9b1787be9f9bf4d55e92a2a8"></a>POLARSSL_CIPHER_AES_192_GCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a5113b084db48bacfe7f8773a8f709a30"></a>POLARSSL_CIPHER_AES_256_GCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6afb71c594cdaf3411cf7768ff57431125"></a>POLARSSL_CIPHER_CAMELLIA_128_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a971ae82c98df3922c99ac98983cf3a86"></a>POLARSSL_CIPHER_CAMELLIA_192_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a89d049ae306bffa6d89431b51c8a786b"></a>POLARSSL_CIPHER_CAMELLIA_256_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a7fbc06c11043b1283a2f0c37063025ef"></a>POLARSSL_CIPHER_CAMELLIA_128_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a25d8a914e19a95d2f95ecb764058d49c"></a>POLARSSL_CIPHER_CAMELLIA_192_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6ad1b4dfdab416de3a5e384e13d622a7a6"></a>POLARSSL_CIPHER_CAMELLIA_256_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a8193cb4f12803423fc303f3f804038a4"></a>POLARSSL_CIPHER_CAMELLIA_128_CFB128</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a9924eac692478f079e815869556553d2"></a>POLARSSL_CIPHER_CAMELLIA_192_CFB128</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a634d2a1fff658d083c07a21175ca6c8e"></a>POLARSSL_CIPHER_CAMELLIA_256_CFB128</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a771ce38dd356f676da95c91c86ac3b2d"></a>POLARSSL_CIPHER_CAMELLIA_128_CTR</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a8ff89c9e9e41ec779b9424f51bfa2fba"></a>POLARSSL_CIPHER_CAMELLIA_192_CTR</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a25905ecd711ed8af6d78bd38b19790de"></a>POLARSSL_CIPHER_CAMELLIA_256_CTR</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a4802ed2b8f0b2201a35bbee4779ca40b"></a>POLARSSL_CIPHER_CAMELLIA_128_GCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a8355e93505e089dbe9fb391e901d6d44"></a>POLARSSL_CIPHER_CAMELLIA_192_GCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a028f9f32aacd390889b29f67c6d9fdcd"></a>POLARSSL_CIPHER_CAMELLIA_256_GCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a14e0f405590439261729bac7ed0be6d4"></a>POLARSSL_CIPHER_DES_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6af14528a0b54195461babbaec8181913c"></a>POLARSSL_CIPHER_DES_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a148083389736dc34ee2d729515482d85"></a>POLARSSL_CIPHER_DES_EDE_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a8ce984017149df219b49fcc1d506ce10"></a>POLARSSL_CIPHER_DES_EDE_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a79352d8566dcb0eb1395d0f4ce4ba0b2"></a>POLARSSL_CIPHER_DES_EDE3_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6ae6ab208bff4f88dbba3277a05686b0a9"></a>POLARSSL_CIPHER_DES_EDE3_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6ade30c0ba8f3b4c0149dc711f595c32a9"></a>POLARSSL_CIPHER_BLOWFISH_ECB</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a38daa50cfa1c23ffda451ea940474a3f"></a>POLARSSL_CIPHER_BLOWFISH_CBC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6ad678b6ae83820aaa338fdd8a9888904d"></a>POLARSSL_CIPHER_BLOWFISH_CFB64</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a0da001217dca5276686d3fe73939bb77"></a>POLARSSL_CIPHER_BLOWFISH_CTR</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6ab7f25ac8ae942ca9cfbe97a65d56ce2e"></a>POLARSSL_CIPHER_ARC4_128</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6ab613ba7e4b52c0cdc64e93d314cd3fbf"></a>POLARSSL_CIPHER_AES_128_CCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6ab62b45d44176c1c74d0894f1245268ae"></a>POLARSSL_CIPHER_AES_192_CCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a2c83917c06819e0159c46d081beeed85"></a>POLARSSL_CIPHER_AES_256_CCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a2c9c1dabfa8c03b612dd7064fedc6540"></a>POLARSSL_CIPHER_CAMELLIA_128_CCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a17e4803d634ea1ee4daa8f26500a6393"></a>POLARSSL_CIPHER_CAMELLIA_192_CCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a806c82ed7e8b591dedc86093f38274e6a80290044d0da4521376ed60d5edc8c67"></a>POLARSSL_CIPHER_CAMELLIA_256_CCM</em>&nbsp;</td><td class="fielddoc">
</td></tr>
</table>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00082">82</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<a class="anchor" id="a76a810650461f2062938ee9b82666b36"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="cipher_8h.html#a76a810650461f2062938ee9b82666b36">operation_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a76a810650461f2062938ee9b82666b36a878b38bff48702f7816ee15e6954b717"></a>POLARSSL_OPERATION_NONE</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a76a810650461f2062938ee9b82666b36ae99cd4d55b496dbb74727f7a6ed872c7"></a>POLARSSL_DECRYPT</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a76a810650461f2062938ee9b82666b36ad8e41c0d381b23d7835dd322e511564f"></a>POLARSSL_ENCRYPT</em>&nbsp;</td><td class="fielddoc">
</td></tr>
</table>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00154">154</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ad2f7c44697223ae63d7814fc7e8b9092"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_auth_decrypt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>iv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>iv_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>ad</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ad_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ilen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>olen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>tag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>tag_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generic autenticated decryption (AEAD ciphers). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>generic cipher context </td></tr>
    <tr><td class="paramname">iv</td><td>IV to use (or NONCE_COUNTER for CTR-mode ciphers) </td></tr>
    <tr><td class="paramname">iv_len</td><td>IV length for ciphers with variable-size IV; discarded by ciphers with fixed-size IV. </td></tr>
    <tr><td class="paramname">ad</td><td>Additional data to be authenticated. </td></tr>
    <tr><td class="paramname">ad_len</td><td>Length of ad. </td></tr>
    <tr><td class="paramname">input</td><td>buffer holding the input data </td></tr>
    <tr><td class="paramname">ilen</td><td>length of the input data </td></tr>
    <tr><td class="paramname">output</td><td>buffer for the output data. Should be able to hold at least ilen. </td></tr>
    <tr><td class="paramname">olen</td><td>length of the output data, will be filled with the actual number of bytes written. </td></tr>
    <tr><td class="paramname">tag</td><td>buffer holding the authentication tag </td></tr>
    <tr><td class="paramname">tag_len</td><td>length of the authentication tag</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, or POLARSSL_ERR_CIPHER_BAD_INPUT_DATA, or POLARSSL_ERR_CIPHER_AUTH_FAILED if data isn't authentic, or a cipher specific error code.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If the data is not authentic, then the output buffer is zeroed out to prevent the unauthentic plaintext to be used by mistake, making this interface safer. </dd></dl>

</div>
</div>
<a class="anchor" id="a30155c676722d3538392b32ac45e8f8a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_auth_encrypt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>iv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>iv_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>ad</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ad_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ilen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>olen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>tag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>tag_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generic autenticated encryption (AEAD ciphers). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>generic cipher context </td></tr>
    <tr><td class="paramname">iv</td><td>IV to use (or NONCE_COUNTER for CTR-mode ciphers) </td></tr>
    <tr><td class="paramname">iv_len</td><td>IV length for ciphers with variable-size IV; discarded by ciphers with fixed-size IV. </td></tr>
    <tr><td class="paramname">ad</td><td>Additional data to authenticate. </td></tr>
    <tr><td class="paramname">ad_len</td><td>Length of ad. </td></tr>
    <tr><td class="paramname">input</td><td>buffer holding the input data </td></tr>
    <tr><td class="paramname">ilen</td><td>length of the input data </td></tr>
    <tr><td class="paramname">output</td><td>buffer for the output data. Should be able to hold at least ilen. </td></tr>
    <tr><td class="paramname">olen</td><td>length of the output data, will be filled with the actual number of bytes written. </td></tr>
    <tr><td class="paramname">tag</td><td>buffer for the authentication tag </td></tr>
    <tr><td class="paramname">tag_len</td><td>desired tag length</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, or POLARSSL_ERR_CIPHER_BAD_INPUT_DATA, or a cipher specific error code. </dd></dl>

</div>
</div>
<a class="anchor" id="a907de4e9c5331d3e0a7d58c887e9173a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_check_tag </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>tag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>tag_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check tag for AEAD ciphers. </p>
<pre class="fragment">                 Currently only supported with GCM.
                 Must be called after cipher_finish().
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>Generic cipher context </td></tr>
    <tr><td class="paramname">tag</td><td>Buffer holding the tag </td></tr>
    <tr><td class="paramname">tag_len</td><td>Length of the tag to check</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, or a specific error code. </dd></dl>

</div>
</div>
<a class="anchor" id="aac61499800e5f1436c61fcdd8be5ba4b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_crypt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>iv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>iv_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ilen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>olen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generic all-in-one encryption/decryption (for all ciphers except AEAD constructs). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>generic cipher context </td></tr>
    <tr><td class="paramname">iv</td><td>IV to use (or NONCE_COUNTER for CTR-mode ciphers) </td></tr>
    <tr><td class="paramname">iv_len</td><td>IV length for ciphers with variable-size IV; discarded by ciphers with fixed-size IV. </td></tr>
    <tr><td class="paramname">input</td><td>buffer holding the input data </td></tr>
    <tr><td class="paramname">ilen</td><td>length of the input data </td></tr>
    <tr><td class="paramname">output</td><td>buffer for the output data. Should be able to hold at least ilen + block_size. Cannot be the same buffer as input! </td></tr>
    <tr><td class="paramname">olen</td><td>length of the output data, will be filled with the actual number of bytes written.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Some ciphers don't use IVs nor NONCE. For these ciphers, use iv = NULL and iv_len = 0.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, or POLARSSL_ERR_CIPHER_BAD_INPUT_DATA, or POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED if decryption expected a full block but was not provided one, or POLARSSL_ERR_CIPHER_INVALID_PADDING on invalid padding while decrypting, or a cipher specific error code. </dd></dl>

</div>
</div>
<a class="anchor" id="a12a036b9caa428f47dfb14c06753f14c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_finish </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>olen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generic cipher finalisation function. </p>
<p>If data still needs to be flushed from an incomplete block, data contained within it will be padded with the size of the last block, and written to the output buffer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>Generic cipher context </td></tr>
    <tr><td class="paramname">output</td><td>buffer to write data to. Needs block_size available. </td></tr>
    <tr><td class="paramname">olen</td><td>length of the data written to the output buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, POLARSSL_ERR_CIPHER_BAD_INPUT_DATA if parameter verification fails, POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED if decryption expected a full block but was not provided one, POLARSSL_ERR_CIPHER_INVALID_PADDING on invalid padding while decrypting or a cipher specific error code. </dd></dl>

</div>
</div>
<a class="anchor" id="af27f8e4cd1fab59615c3d73c69d136c8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cipher_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Free and clear the cipher-specific context of ctx. </p>
<p>Freeing ctx itself remains the responsibility of the caller. </p>

</div>
</div>
<a class="anchor" id="ac8abe3c96c800481697cfe8260cf829d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_free_ctx </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Free the cipher-specific context of ctx. </p>
<p>Freeing ctx itself remains the responsibility of the caller.</p>
<dl class="section note"><dt>Note</dt><dd>Deprecated: Redirects to <a class="el" href="cipher_8h.html#af27f8e4cd1fab59615c3d73c69d136c8" title="Free and clear the cipher-specific context of ctx. ">cipher_free()</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>Free the cipher-specific context</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 </dd></dl>

</div>
</div>
<a class="anchor" id="ac3ffcee4725c03638726f7211b31bcb7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static unsigned int cipher_get_block_size </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the block size of the given cipher. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>cipher's context. Must have been initialised.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>size of the cipher's blocks, or 0 if ctx has not been initialised. </dd></dl>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00384">384</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

<p>References <a class="el" href="cipher_8h_source.html#l00248">cipher_info_t::block_size</a>, and <a class="el" href="cipher_8h_source.html#l00260">cipher_context_t::cipher_info</a>.</p>

</div>
</div>
<a class="anchor" id="a8cc9566954343cc25ab4432db0c3a353"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179c">cipher_mode_t</a> cipher_get_cipher_mode </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the mode of operation for the cipher. </p>
<pre class="fragment">                 (e.g. POLARSSL_MODE_CBC)
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>cipher's context. Must have been initialised.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>mode of operation, or POLARSSL_MODE_NONE if ctx has not been initialised. </dd></dl>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00401">401</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

<p>References <a class="el" href="cipher_8h_source.html#l00260">cipher_context_t::cipher_info</a>, <a class="el" href="cipher_8h_source.html#l00231">cipher_info_t::mode</a>, and <a class="el" href="cipher_8h_source.html#l00135">POLARSSL_MODE_NONE</a>.</p>

</div>
</div>
<a class="anchor" id="a0555cab5391282ebcb61a899c00addec"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int cipher_get_iv_size </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the size of the cipher's IV/NONCE in bytes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>cipher's context. Must have been initialised.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>If IV has not been set yet: (recommended) IV size (0 for ciphers not using IV/NONCE). If IV has already been set: actual size. </dd></dl>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00418">418</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

<p>References <a class="el" href="cipher_8h_source.html#l00260">cipher_context_t::cipher_info</a>, <a class="el" href="cipher_8h_source.html#l00242">cipher_info_t::iv_size</a>, and <a class="el" href="cipher_8h_source.html#l00282">cipher_context_t::iv_size</a>.</p>

</div>
</div>
<a class="anchor" id="a9534326eea78885a9b47ce0b0a3aa0d3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int cipher_get_key_size </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the key length of the cipher. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>cipher's context. Must have been initialised.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>cipher's key length, in bits, or POLARSSL_KEY_LENGTH_NONE if ctx has not been initialised. </dd></dl>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00469">469</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

<p>References <a class="el" href="cipher_8h_source.html#l00260">cipher_context_t::cipher_info</a>, <a class="el" href="cipher_8h_source.html#l00235">cipher_info_t::key_length</a>, and <a class="el" href="cipher_8h_source.html#l00162">POLARSSL_KEY_LENGTH_NONE</a>.</p>

</div>
</div>
<a class="anchor" id="ab13b86afbee6e045811edf5601dc5ce5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static const char* cipher_get_name </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the name of the given cipher, as a string. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>cipher's context. Must have been initialised.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>name of the cipher, or NULL if ctx was not initialised. </dd></dl>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00452">452</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

<p>References <a class="el" href="cipher_8h_source.html#l00260">cipher_context_t::cipher_info</a>, and <a class="el" href="cipher_8h_source.html#l00238">cipher_info_t::name</a>.</p>

</div>
</div>
<a class="anchor" id="ab6316d711155a6ba661d6dd18eaf3bf2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="cipher_8h.html#a76a810650461f2062938ee9b82666b36">operation_t</a> cipher_get_operation </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the operation of the given cipher. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>cipher's context. Must have been initialised.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>operation (POLARSSL_ENCRYPT or POLARSSL_DECRYPT), or POLARSSL_OPERATION_NONE if ctx has not been initialised. </dd></dl>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00486">486</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

<p>References <a class="el" href="cipher_8h_source.html#l00260">cipher_context_t::cipher_info</a>, <a class="el" href="cipher_8h_source.html#l00266">cipher_context_t::operation</a>, and <a class="el" href="cipher_8h_source.html#l00155">POLARSSL_OPERATION_NONE</a>.</p>

</div>
</div>
<a class="anchor" id="a07c79d24f8381fade8fcad38b8351f79"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6">cipher_type_t</a> cipher_get_type </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the type of the given cipher. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>cipher's context. Must have been initialised.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>type of the cipher, or POLARSSL_CIPHER_NONE if ctx has not been initialised. </dd></dl>

<p>Definition at line <a class="el" href="cipher_8h_source.html#l00437">437</a> of file <a class="el" href="cipher_8h_source.html">cipher.h</a>.</p>

<p>References <a class="el" href="cipher_8h_source.html#l00260">cipher_context_t::cipher_info</a>, <a class="el" href="cipher_8h_source.html#l00083">POLARSSL_CIPHER_NONE</a>, and <a class="el" href="cipher_8h_source.html#l00228">cipher_info_t::type</a>.</p>

</div>
</div>
<a class="anchor" id="a76763329d5579d862dfca01adf32c05b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structcipher__info__t.html">cipher_info_t</a>* cipher_info_from_string </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>cipher_name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the cipher information structure associated with the given cipher name. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cipher_name</td><td>Name of the cipher to search for.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the cipher information structure associated with the given cipher_name, or NULL if not found. </dd></dl>

</div>
</div>
<a class="anchor" id="a1a6dfa43a6758eb075dd2eb86b538900"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structcipher__info__t.html">cipher_info_t</a>* cipher_info_from_type </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="cipher_8h.html#a806c82ed7e8b591dedc86093f38274e6">cipher_type_t</a>&#160;</td>
          <td class="paramname"><em>cipher_type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the cipher information structure associated with the given cipher type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cipher_type</td><td>Type of the cipher to search for.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the cipher information structure associated with the given cipher_type, or NULL if not found. </dd></dl>

</div>
</div>
<a class="anchor" id="a68fd6a4ea2c236dc4abcad76d73d5cac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structcipher__info__t.html">cipher_info_t</a>* cipher_info_from_values </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="cipher_8h.html#a373f5d3a0a42c77ff4f5fe4fe7da0560">cipher_id_t</a>&#160;</td>
          <td class="paramname"><em>cipher_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>key_length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="cipher_8h.html#af65d0bd9b5c3504fd010cf54955b179c">cipher_mode_t</a>&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the cipher information structure associated with the given cipher id, key size and mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cipher_id</td><td>Id of the cipher to search for (e.g. POLARSSL_CIPHER_ID_AES) </td></tr>
    <tr><td class="paramname">key_length</td><td>Length of the key in bits </td></tr>
    <tr><td class="paramname">mode</td><td>Cipher mode (e.g. POLARSSL_MODE_CBC)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the cipher information structure associated with the given cipher_type, or NULL if not found. </dd></dl>

</div>
</div>
<a class="anchor" id="a6a719708dc3b2f0d0e7beadccf871f4f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cipher_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize a cipher_context (as NONE) </p>

</div>
</div>
<a class="anchor" id="adc7c37e925193805884085ca87587f64"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_init_ctx </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcipher__info__t.html">cipher_info_t</a> *&#160;</td>
          <td class="paramname"><em>cipher_info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialises and fills the cipher context structure with the appropriate values. </p>
<dl class="section note"><dt>Note</dt><dd>Currently also clears structure. In future versions you will be required to call <a class="el" href="cipher_8h.html#a6a719708dc3b2f0d0e7beadccf871f4f" title="Initialize a cipher_context (as NONE) ">cipher_init()</a> on the structure first.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>context to initialise. May not be NULL. </td></tr>
    <tr><td class="paramname">cipher_info</td><td>cipher to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, POLARSSL_ERR_CIPHER_BAD_INPUT_DATA on parameter failure, POLARSSL_ERR_CIPHER_ALLOC_FAILED if allocation of the cipher-specific context failed. </dd></dl>

</div>
</div>
<a class="anchor" id="a036719c5224e57cf8469ebf9daceb137"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const int* cipher_list </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the list of ciphers supported by the generic cipher module. </p>
<dl class="section return"><dt>Returns</dt><dd>a statically allocated array of ciphers, the last entry is 0. </dd></dl>

</div>
</div>
<a class="anchor" id="a0a55a8eeae5ebb2627c59257ffb202bc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_reset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Finish preparation of the given context. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>generic cipher context</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, POLARSSL_ERR_CIPHER_BAD_INPUT_DATA if parameter verification fails. </dd></dl>

</div>
</div>
<a class="anchor" id="ae9adb04c9894c75bbf71189d25b1b988"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_self_test </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>verbose</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checkup routine. </p>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or 1 if the test failed </dd></dl>

</div>
</div>
<a class="anchor" id="abca5954bfff4e62c5280267d2a97171d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_set_iv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>iv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>iv_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the initialization vector (IV) or nonce. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>generic cipher context </td></tr>
    <tr><td class="paramname">iv</td><td>IV to use (or NONCE_COUNTER for CTR-mode ciphers) </td></tr>
    <tr><td class="paramname">iv_len</td><td>IV length for ciphers with variable-size IV; discarded by ciphers with fixed-size IV.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, or POLARSSL_ERR_CIPHER_BAD_INPUT_DATA</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Some ciphers don't use IVs nor NONCE. For these ciphers, this function has no effect. </dd></dl>

</div>
</div>
<a class="anchor" id="abbc809fe32e1cce35834006d1edf1f2c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_set_padding_mode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="cipher_8h.html#acb17eb5d2106ba020a20b70d878aa7dd">cipher_padding_t</a>&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set padding mode, for cipher modes that use padding. </p>
<pre class="fragment">                 (Default: PKCS7 padding.)
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>generic cipher context </td></tr>
    <tr><td class="paramname">mode</td><td>padding mode</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE if selected padding mode is not supported, or POLARSSL_ERR_CIPHER_BAD_INPUT_DATA if the cipher mode does not support padding. </dd></dl>

</div>
</div>
<a class="anchor" id="a77355bddf2d69f68d55e2bd2374e9257"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_setkey </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>key_length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="cipher_8h.html#a76a810650461f2062938ee9b82666b36">operation_t</a>&#160;</td>
          <td class="paramname"><em>operation</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the key to use with the given context. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>generic cipher context. May not be NULL. Must have been initialised using cipher_context_from_type or cipher_context_from_string. </td></tr>
    <tr><td class="paramname">key</td><td>The key to use. </td></tr>
    <tr><td class="paramname">key_length</td><td>key length to use, in bits. </td></tr>
    <tr><td class="paramname">operation</td><td>Operation that the key will be used for, either POLARSSL_ENCRYPT or POLARSSL_DECRYPT.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, POLARSSL_ERR_CIPHER_BAD_INPUT_DATA if parameter verification fails or a cipher specific error code. </dd></dl>

</div>
</div>
<a class="anchor" id="afca62e9b6e95da3a46fa6c95f0a09e38"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_update </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ilen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>olen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generic cipher update function. </p>
<p>Encrypts/decrypts using the given cipher context. Writes as many block size'd blocks of data as possible to output. Any data that cannot be written immediately will either be added to the next block, or flushed when cipher_final is called. Exception: for POLARSSL_MODE_ECB, expects single block in size (e.g. 16 bytes for AES)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>generic cipher context </td></tr>
    <tr><td class="paramname">input</td><td>buffer holding the input data </td></tr>
    <tr><td class="paramname">ilen</td><td>length of the input data </td></tr>
    <tr><td class="paramname">output</td><td>buffer for the output data. Should be able to hold at least ilen + block_size. Cannot be the same buffer as input! </td></tr>
    <tr><td class="paramname">olen</td><td>length of the output data, will be filled with the actual number of bytes written.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, POLARSSL_ERR_CIPHER_BAD_INPUT_DATA if parameter verification fails, POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE on an unsupported mode for a cipher or a cipher specific error code.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If the underlying cipher is GCM, all calls to this function, except the last one before <a class="el" href="cipher_8h.html#a12a036b9caa428f47dfb14c06753f14c" title="Generic cipher finalisation function. ">cipher_finish()</a>, must have ilen a multiple of the block size. </dd></dl>

</div>
</div>
<a class="anchor" id="a5b8cb1cff4b19e01849c84c67364500d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_update_ad </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>ad</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ad_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add additional data (for AEAD ciphers). </p>
<pre class="fragment">                 Currently only supported with GCM.
                 Must be called exactly once, after cipher_reset().
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>generic cipher context </td></tr>
    <tr><td class="paramname">ad</td><td>Additional data to use. </td></tr>
    <tr><td class="paramname">ad_len</td><td>Length of ad.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, or a specific error code. </dd></dl>

</div>
</div>
<a class="anchor" id="a54a922d31e506aa36dd8ed7798ed2a41"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cipher_write_tag </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcipher__context__t.html">cipher_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>tag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>tag_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write tag for AEAD ciphers. </p>
<pre class="fragment">                 Currently only supported with GCM.
                 Must be called after cipher_finish().
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>Generic cipher context </td></tr>
    <tr><td class="paramname">tag</td><td>buffer to write the tag </td></tr>
    <tr><td class="paramname">tag_len</td><td>Length of the tag to write</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, or a specific error code. </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jul 31 2014 11:35:55 for PolarSSL v1.3.8 by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>