<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.mcrypt.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'mcrypt.constants.php',
    1 => 'Попередньо визначені константи',
    2 => 'Попередньо визначені константи',
  ),
  'up' => 
  array (
    0 => 'book.mcrypt.php',
    1 => 'Mcrypt',
  ),
  'prev' => 
  array (
    0 => 'mcrypt.resources.php',
    1 => 'Типи ресурсів',
  ),
  'next' => 
  array (
    0 => 'mcrypt.ciphers.php',
    1 => 'Mcrypt ciphers',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mcrypt/constants.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mcrypt.constants" class="appendix">
 <h1 class="title">Попередньо визначені константи</h1>

 <p class="simpara">
Константи, описані нижче — визначені цим розширенням, тож доступні, коли
розширення скомпільовано як частина PHP або динамічно підключене під час
виконання.
</p>
 <p class="para">
  Mcrypt can operate in four block cipher modes (<code class="literal">CBC</code>,
  <code class="literal">OFB</code>, <code class="literal">CFB</code>, and
  <code class="literal">ECB</code>). If linked against libmcrypt-2.4.x or higher the
  functions can also operate in the block cipher mode <code class="literal">nOFB</code>
  and in <code class="literal">STREAM</code> mode. Below you find a list with all
  supported encryption modes together with the constants that are
  defined for the encryption mode.  For a more complete reference and
  discussion see Applied Cryptography by Schneier (ISBN 0-471-11709-9).
  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     <strong><code>MCRYPT_MODE_ECB</code></strong> (<code class="literal">electronic
     codebook</code>) is a block cipher mode that is generally
     unsuitable for most purposes. The use of this mode is not recommended.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <strong><code>MCRYPT_MODE_CBC</code></strong> (<code class="literal">cipher block
     chaining</code>) is a block cipher mode that is significantly
     more secure than <code class="literal">ECB</code> mode.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <strong><code>MCRYPT_MODE_CFB</code></strong> (<code class="literal">cipher
     feedback, in 8-bit mode</code>) is a stream cipher mode.
     It is recommended to use <code class="literal">NCFB</code> mode rather
     than <code class="literal">CFB</code> mode.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <strong><code>MCRYPT_MODE_OFB</code></strong> (<code class="literal">output feedback, in
     8-bit mode</code>) is a stream cipher mode comparable to <code class="literal">CFB</code>, but
     can be used in applications where error propagation cannot
     be tolerated.
     It is recommended to use <code class="literal">NOFB</code> mode rather
     than <code class="literal">OFB</code> mode.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <strong><code>MCRYPT_MODE_NOFB</code></strong> (<code class="literal">output feedback,
     in n-bit mode</code>) is comparable to <code class="literal">OFB</code> mode,
     but operates on the full block size of the algorithm.
    </span>
   </li> 
   <li class="listitem">
    <span class="simpara">
     <strong><code>MCRYPT_MODE_STREAM</code></strong> is an extra mode to include
     some stream algorithms like <code class="literal">&quot;WAKE&quot;</code> or <code class="literal">&quot;RC4&quot;</code>.
    </span>
   </li> 
  </ul>
 </p>
 
 <p class="para">
  Mcrypt supports some other modes of operation for which there are no predefined constants.
  They can be utilised by passing a string in place of the missing constants.
  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     <code class="literal">&quot;ctr&quot;</code> (<code class="literal">counter mode</code>) is a stream cipher mode.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <code class="literal">&quot;ncfb&quot;</code> (<code class="literal">cipher feedback,
     in n-bit mode</code>) is comparable to <code class="literal">CFB</code> mode, 
     but operates on the full block size of the algorithm.
    </span>
   </li>
  </ul>
 </p>

 <p class="para">
  Some other mode and random device constants:
  <dl>
   
    <dt id="constant.mcrypt-encrypt">
     <strong><code><a href="mcrypt.constants.php#constant.mcrypt-encrypt">MCRYPT_ENCRYPT</a></code></strong> 
     (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
    </dt>
    <dd>
     <span class="simpara">
      
     </span>
    </dd>
   
   
    <dt id="constant.mcrypt-decrypt">
     <strong><code><a href="mcrypt.constants.php#constant.mcrypt-decrypt">MCRYPT_DECRYPT</a></code></strong> 
     (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
    </dt>
    <dd>
     <span class="simpara">
      
     </span>
    </dd>
   
   
    <dt id="constant.mcrypt-dev-random">
     <strong><code><a href="mcrypt.constants.php#constant.mcrypt-dev-random">MCRYPT_DEV_RANDOM</a></code></strong> 
     (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
    </dt>
    <dd>
     <span class="simpara">
      
     </span>
    </dd>
   
   
    <dt id="constant.mcrypt-dev-urandom">
     <strong><code><a href="mcrypt.constants.php#constant.mcrypt-dev-urandom">MCRYPT_DEV_URANDOM</a></code></strong> 
     (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
    </dt>
    <dd>
     <span class="simpara">
      
     </span>
    </dd>
   
   
    <dt id="constant.mcrypt-rand">
     <strong><code><a href="mcrypt.constants.php#constant.mcrypt-rand">MCRYPT_RAND</a></code></strong> 
     (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
    </dt>
    <dd>
     <span class="simpara">
      
     </span>
    </dd>
   
  </dl>
 </p>
</div>
<?php manual_footer($setup); ?>