1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Single Block Cipher API</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="API.html" title="Chapter&#160;5.&#160;Programming Interface"><link rel="prev" href="API-crypto-blkcipher-get-iv.html" title="crypto_blkcipher_get_iv"><link rel="next" href="API-crypto-alloc-cipher.html" title="crypto_alloc_cipher"></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">Single Block Cipher API</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-crypto-blkcipher-get-iv.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;5.&#160;Programming Interface</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-crypto-alloc-cipher.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1097894084"></a>Single Block Cipher API</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-crypto-alloc-cipher.html"><span class="phrase">crypto_alloc_cipher</span></a></span><span class="refpurpose"> &#8212; 
2  allocate single block cipher handle
3 </span></dt><dt><span class="refentrytitle"><a href="API-crypto-free-cipher.html"><span class="phrase">crypto_free_cipher</span></a></span><span class="refpurpose"> &#8212; 
4  zeroize and free the single block cipher handle
5 </span></dt><dt><span class="refentrytitle"><a href="API-crypto-has-cipher.html"><span class="phrase">crypto_has_cipher</span></a></span><span class="refpurpose"> &#8212; 
6  Search for the availability of a single block cipher
7 </span></dt><dt><span class="refentrytitle"><a href="API-crypto-cipher-blocksize.html"><span class="phrase">crypto_cipher_blocksize</span></a></span><span class="refpurpose"> &#8212; 
8  obtain block size for cipher
9 </span></dt><dt><span class="refentrytitle"><a href="API-crypto-cipher-setkey.html"><span class="phrase">crypto_cipher_setkey</span></a></span><span class="refpurpose"> &#8212; 
10  set key for cipher
11 </span></dt><dt><span class="refentrytitle"><a href="API-crypto-cipher-encrypt-one.html"><span class="phrase">crypto_cipher_encrypt_one</span></a></span><span class="refpurpose"> &#8212; 
12  encrypt one block of plaintext
13 </span></dt><dt><span class="refentrytitle"><a href="API-crypto-cipher-decrypt-one.html"><span class="phrase">crypto_cipher_decrypt_one</span></a></span><span class="refpurpose"> &#8212; 
14  decrypt one block of ciphertext
15 </span></dt></dl></div><p>
16   </p><p>
17   The single block cipher API is used with the ciphers of type
18   CRYPTO_ALG_TYPE_CIPHER (listed as type <span class="quote">&#8220;<span class="quote">cipher</span>&#8221;</span> in /proc/crypto).
19   </p><p>
20   Using the single block cipher API calls, operations with the basic cipher
21   primitive can be implemented. These cipher primitives exclude any block
22   chaining operations including IV handling.
23   </p><p>
24   The purpose of this single block cipher API is to support the implementation
25   of templates or other concepts that only need to perform the cipher operation
26   on one block at a time. Templates invoke the underlying cipher primitive
27   block-wise and process either the input or the output data of these cipher
28   operations.
29</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-crypto-blkcipher-get-iv.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="API.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-crypto-alloc-cipher.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">crypto_blkcipher_get_iv</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">crypto_alloc_cipher</span></td></tr></table></div></body></html>
30