This file is indexed.

/usr/share/doc/libucommon-dev/a00038.html is in libucommon-doc 3.2.0-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<!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"/>
<title>UCommon: ucc::Cipher Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&nbsp;Structure&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="a00214.html">ucc</a>::<a class="el" href="a00038.html">Cipher</a>
  </div>
</div>
<div class="contents">
<h1>ucc::Cipher Class Reference</h1><!-- doxytag: class="ucc::Cipher" -->
<p>A generic data ciphering class.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00203_source.html">secure.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for ucc::Cipher:</div>
<div class="dynsection">
<div class="center"><img src="a00371.png" border="0" usemap="#ucc_1_1_cipher_coll__map" alt="Collaboration graph"/></div>
<map name="ucc_1_1_cipher_coll__map" id="ucc_1_1_cipher_coll__map">
<area shape="rect" id="node2" href="a00039.html" title="Cipher key formed by hash algorithm." alt="" coords="5,5,128,35"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html">Key</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="a00038.html" title="A generic data ciphering class.">Cipher</a> key formed by hash algorithm.  <a href="a00039.html#_details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aafd992dba14205bb05f48e1d4fb3ace0"></a><!-- doxytag: member="ucc::Cipher::key_t" ref="aafd992dba14205bb05f48e1d4fb3ace0" args="" -->
typedef <a class="el" href="a00039.html">Key</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><b>key_t</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><b>mode_t</b> { <b>ENCRYPT</b> =  1, 
<b>DECRYPT</b> =  0
 }</td></tr>
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a60e94545a35174d361af0198a952ed4d"></a><!-- doxytag: member="ucc::Cipher::align" ref="a60e94545a35174d361af0198a952ed4d" args="(void)" -->
size_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>align</b> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af14c085e16520b96ad40ecc3ef1b4e68"></a><!-- doxytag: member="ucc::Cipher::Cipher" ref="af14c085e16520b96ad40ecc3ef1b4e68" args="(key_t key, mode_t mode, unsigned char *address=NULL, size_t size=0)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><b>Cipher</b> (<a class="el" href="a00039.html">key_t</a> key, mode_t mode, unsigned char *address=NULL, size_t size=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#a1096f10eef3aed08e418024297172d3d">flush</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Push a final cipher block.  <a href="#a1096f10eef3aed08e418024297172d3d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#a5aeb9b862d8eb600adb0aea15a5cb32b">pad</a> (const unsigned char *address, size_t size)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This is used to process any data unaligned to the blocksize at the end of a cipher session.  <a href="#a5aeb9b862d8eb600adb0aea15a5cb32b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7e233f6fd32cb9a597c4a3565001eee9"></a><!-- doxytag: member="ucc::Cipher::pos" ref="a7e233f6fd32cb9a597c4a3565001eee9" args="(void)" -->
size_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>pos</b> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#abba6b4e04cce5e1268b33d4a2b278b52">process</a> (unsigned char *address, size_t size, bool flag=false)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Process encrypted data in-place.  <a href="#abba6b4e04cce5e1268b33d4a2b278b52"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#ad36182c184e7d291c55a48aad2213996">put</a> (const unsigned char *data, size_t size)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Process cipher data.  <a href="#ad36182c184e7d291c55a48aad2213996"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#a1aa2f274cf74f3851b5b2cefd7798b3d">puts</a> (const char *<a class="el" href="a00157.html">string</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This essentially encrypts a single string and pads with NULL bytes as needed.  <a href="#a1aa2f274cf74f3851b5b2cefd7798b3d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a17d2b94d36731b2e437280d6a05602a1"></a><!-- doxytag: member="ucc::Cipher::set" ref="a17d2b94d36731b2e437280d6a05602a1" args="(key_t key, mode_t mode, unsigned char *address, size_t size=0)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>set</b> (<a class="el" href="a00039.html">key_t</a> key, mode_t mode, unsigned char *address, size_t size=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af81be3a1d067a7e2765546249e13a15f"></a><!-- doxytag: member="ucc::Cipher::set" ref="af81be3a1d067a7e2765546249e13a15f" args="(unsigned char *address, size_t size=0)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>set</b> (unsigned char *address, size_t size=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5e6d97bab39fc8cebc36786c6c0f33bb"></a><!-- doxytag: member="ucc::Cipher::size" ref="a5e6d97bab39fc8cebc36786c6c0f33bb" args="(void)" -->
size_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>size</b> (void)</td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#a32d885bc068c6315dcc39a1b2d7f3069">is</a> (const char *name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Check if a specific cipher is supported.  <a href="#a32d885bc068c6315dcc39a1b2d7f3069"></a><br/></td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa1c88d6d3bbc78062c37b712b8d68f8"></a><!-- doxytag: member="ucc::Cipher::push" ref="aaa1c88d6d3bbc78062c37b712b8d68f8" args="(unsigned char *address, size_t size)" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><b>push</b> (unsigned char *address, size_t size)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae887973992ebb7a877f8dbf8e346842b"></a><!-- doxytag: member="ucc::Cipher::release" ref="ae887973992ebb7a877f8dbf8e346842b" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>release</b> (void)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>A generic data ciphering class. </p>
<p>This is used to construct crytographic ciphers to encode and decode data as needed. The cipher type is specified by the key object. This class can be used to send output streaming to memory or in a fixed size buffer. If the latter is used, a <a class="el" href="a00214.html#ad3c146b0a18955ca36ae65ef8edacaa0" title="Push a linked object onto a stack of linked objects.">push()</a> method is called through a virtual when the buffer is full. Since block ciphers are used, buffers should be aligned to the block size. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>David Sugar &lt;<a href="mailto:dyfet@gnutelephony.org">dyfet@gnutelephony.org</a>&gt; </dd></dl>

<p>Definition at line <a class="el" href="a00203_source.html#l00223">223</a> of file <a class="el" href="a00203_source.html">secure.h</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a1096f10eef3aed08e418024297172d3d"></a><!-- doxytag: member="ucc::Cipher::flush" ref="a1096f10eef3aed08e418024297172d3d" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t ucc::Cipher::flush </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Push a final cipher block. </p>
<p>This is used to push the final buffer into the push method for any remaining data. </p>

</div>
</div>
<a class="anchor" id="a32d885bc068c6315dcc39a1b2d7f3069"></a><!-- doxytag: member="ucc::Cipher::is" ref="a32d885bc068c6315dcc39a1b2d7f3069" args="(const char *name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static bool ucc::Cipher::is </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>name</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check if a specific cipher is supported. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>of cipher to check. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if supported, false if not. </dd></dl>

</div>
</div>
<a class="anchor" id="a5aeb9b862d8eb600adb0aea15a5cb32b"></a><!-- doxytag: member="ucc::Cipher::pad" ref="a5aeb9b862d8eb600adb0aea15a5cb32b" args="(const unsigned char *address, size_t size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t ucc::Cipher::pad </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&nbsp;</td>
          <td class="paramname"> <em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This is used to process any data unaligned to the blocksize at the end of a cipher session. </p>
<p>On an encryption, it will add padding or an entire padding block with the number of bytes to strip. On decryption it will remove padding at the end. The pkcs5 method of padding with removal count is used. This also sets the address buffer to NULL to prevent further puts until reset. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>address</em>&nbsp;</td><td>of data to add before final pad. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>of data to add before final pad. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>actual bytes encrypted or decrypted. </dd></dl>

</div>
</div>
<a class="anchor" id="abba6b4e04cce5e1268b33d4a2b278b52"></a><!-- doxytag: member="ucc::Cipher::process" ref="abba6b4e04cce5e1268b33d4a2b278b52" args="(unsigned char *address, size_t size, bool flag=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t ucc::Cipher::process </td>
          <td>(</td>
          <td class="paramtype">unsigned char *&nbsp;</td>
          <td class="paramname"> <em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>flag</em> = <code>false</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Process encrypted data in-place. </p>
<p>This assumes no need to set the address buffer. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>address</em>&nbsp;</td><td>of data to process. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>of data to process. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>flag</em>&nbsp;</td><td>if to pad data. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>bytes processed and written back to buffer. </dd></dl>

</div>
</div>
<a class="anchor" id="ad36182c184e7d291c55a48aad2213996"></a><!-- doxytag: member="ucc::Cipher::put" ref="ad36182c184e7d291c55a48aad2213996" args="(const unsigned char *data, size_t size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t ucc::Cipher::put </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Process cipher data. </p>
<p>This requires the size to be a multiple of the cipher block size. If an unaligned sized block of data is used, it will be ignored and the size returned will be 0. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>to process. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>of data to process. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>size of processed output, should be same as size or 0 if error. </dd></dl>

</div>
</div>
<a class="anchor" id="a1aa2f274cf74f3851b5b2cefd7798b3d"></a><!-- doxytag: member="ucc::Cipher::puts" ref="a1aa2f274cf74f3851b5b2cefd7798b3d" args="(const char *string)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t ucc::Cipher::puts </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>string</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This essentially encrypts a single string and pads with NULL bytes as needed. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>string</em>&nbsp;</td><td>to encrypt. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>total encrypted size. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>ucommon/<a class="el" href="a00203_source.html">secure.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 6 08:22:27 2010 for UCommon by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>