1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Cipher Allocation Type And Masks</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="Architecture.html" title="Chapter&#160;2.&#160;Kernel Crypto API Architecture"><link rel="prev" href="ch02s05.html" title="Key Sizes"><link rel="next" href="ch02s07.html" title="Internal Structure of Kernel Crypto API"></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">Cipher Allocation Type And Masks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s05.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;2.&#160;Kernel Crypto API Architecture</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch02s07.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1094411404"></a>Cipher Allocation Type And Masks</h2></div></div></div><p>
2     The different cipher handle allocation functions allow the
3     specification of a type and mask flag. Both parameters have
4     the following meaning (and are therefore not covered in the
5     subsequent sections).
6    </p><p>
7     The type flag specifies the type of the cipher algorithm.
8     The caller usually provides a 0 when the caller wants the
9     default handling. Otherwise, the caller may provide the
10     following selections which match the the aforementioned
11     cipher types:
12    </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>CRYPTO_ALG_TYPE_CIPHER Single block cipher</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_COMPRESS Compression</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_AEAD Authenticated Encryption with
13      Associated Data (MAC)</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_BLKCIPHER Synchronous multi-block cipher</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_ABLKCIPHER Asynchronous multi-block cipher</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_GIVCIPHER Asynchronous multi-block
14       cipher packed together with an IV generator (see geniv field
15       in the /proc/crypto listing for the known IV generators)</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_DIGEST Raw message digest</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_HASH Alias for CRYPTO_ALG_TYPE_DIGEST</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_SHASH Synchronous multi-block hash</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_AHASH Asynchronous multi-block hash</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_RNG Random Number Generation</p></li><li class="listitem"><p>CRYPTO_ALG_TYPE_PCOMPRESS Enhanced version of
16       CRYPTO_ALG_TYPE_COMPRESS allowing for segmented compression /
17       decompression instead of performing the operation on one
18       segment only. CRYPTO_ALG_TYPE_PCOMPRESS is intended to replace
19       CRYPTO_ALG_TYPE_COMPRESS once existing consumers are converted.</p></li></ul></div><p>
20     The mask flag restricts the type of cipher. The only allowed
21     flag is CRYPTO_ALG_ASYNC to restrict the cipher lookup function
22     to asynchronous ciphers. Usually, a caller provides a 0 for the
23     mask flag.
24    </p><p>
25     When the caller provides a mask and type specification, the
26     caller limits the search the kernel crypto API can perform for
27     a suitable cipher implementation for the given cipher name.
28     That means, even when a caller uses a cipher name that exists
29     during its initialization call, the kernel crypto API may not
30     select it due to the used type and mask field.
31    </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s05.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="Architecture.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch02s07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Key Sizes&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Internal Structure of Kernel Crypto API</td></tr></table></div></body></html>
32