1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>struct aead_alg</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Kernel Crypto API"><link rel="up" href="ch05s02.html" title="Block Cipher Algorithm Definitions"><link rel="prev" href="API-struct-ablkcipher-alg.html" title="struct ablkcipher_alg"><link rel="next" href="API-struct-blkcipher-alg.html" title="struct blkcipher_alg"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct aead_alg</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-ablkcipher-alg.html">Prev</a> </td><th width="60%" align="center">Block Cipher Algorithm Definitions</th><td width="20%" align="right"> <a accesskey="n" href="API-struct-blkcipher-alg.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-aead-alg"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct aead_alg — 2 AEAD cipher definition 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting"> 4struct aead_alg { 5 int (* setkey) (struct crypto_aead *tfm, const u8 *key,unsigned int keylen); 6 int (* setauthsize) (struct crypto_aead *tfm, unsigned int authsize); 7 int (* encrypt) (struct aead_request *req); 8 int (* decrypt) (struct aead_request *req); 9 int (* init) (struct crypto_aead *tfm); 10 void (* exit) (struct crypto_aead *tfm); 11 const char * geniv; 12 unsigned int ivsize; 13 unsigned int maxauthsize; 14}; </pre></div><div class="refsect1"><a name="id-1.7.4.6.5"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">setkey</span></dt><dd><p> 15see struct ablkcipher_alg 16 </p></dd><dt><span class="term">setauthsize</span></dt><dd><p> 17Set authentication size for the AEAD transformation. This 18function is used to specify the consumer requested size of the 19authentication tag to be either generated by the transformation 20during encryption or the size of the authentication tag to be 21supplied during the decryption operation. This function is also 22responsible for checking the authentication tag size for 23validity. 24 </p></dd><dt><span class="term">encrypt</span></dt><dd><p> 25see struct ablkcipher_alg 26 </p></dd><dt><span class="term">decrypt</span></dt><dd><p> 27see struct ablkcipher_alg 28 </p></dd><dt><span class="term">init</span></dt><dd><p> 29Initialize the cryptographic transformation object. This function 30is used to initialize the cryptographic transformation object. 31This function is called only once at the instantiation time, right 32after the transformation context was allocated. In case the 33cryptographic hardware has some special requirements which need to 34be handled by software, this function shall check for the precise 35requirement of the transformation and put any software fallbacks 36in place. 37 </p></dd><dt><span class="term">exit</span></dt><dd><p> 38Deinitialize the cryptographic transformation object. This is a 39counterpart to <em class="parameter"><code>init</code></em>, used to remove various changes set in 40<em class="parameter"><code>init</code></em>. 41 </p></dd><dt><span class="term">geniv</span></dt><dd><p> 42see struct ablkcipher_alg 43 </p></dd><dt><span class="term">ivsize</span></dt><dd><p> 44see struct ablkcipher_alg 45 </p></dd><dt><span class="term">maxauthsize</span></dt><dd><p> 46Set the maximum authentication tag size supported by the 47transformation. A transformation may support smaller tag sizes. 48As the authentication tag is a message digest to ensure the 49integrity of the encrypted data, a consumer typically wants the 50largest authentication tag possible as defined by this 51variable. 52 </p></dd></dl></div></div><div class="refsect1"><a name="id-1.7.4.6.6"></a><h2>Description</h2><p> 53 All fields except <em class="parameter"><code>ivsize</code></em> is mandatory and must be filled. 54</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-ablkcipher-alg.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch05s02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-struct-blkcipher-alg.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct ablkcipher_alg</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">struct blkcipher_alg</span></td></tr></table></div></body></html> 55