Typos fixed, and some files were restructured

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@306414 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Braian Iván Monnier 2010-12-17 19:06:44 +00:00
parent 4a436e6205
commit 4a5d31d554
25 changed files with 110 additions and 92 deletions

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mcrypt-cbc" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_cbc</refname>
<refpurpose>Encrypt/decrypt data in CBC mode</refpurpose>
<refpurpose>Encrypts/decrypts data in CBC mode</refpurpose>
</refnamediv>
<refsect1 role="description">

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mcrypt-cfb" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_cfb</refname>
<refpurpose>Encrypt/decrypt data in CFB mode</refpurpose>
<refpurpose>Encrypts/decrypts data in CFB mode</refpurpose>
</refnamediv>
<refsect1 role="description">

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mcrypt-create-iv" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mcrypt_create_iv</refname>
<refpurpose>Create an initialization vector (IV) from a random source</refpurpose>
<refpurpose>Creates an initialization vector (IV) from a random source</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -14,7 +14,7 @@
<methodparam choice="opt"><type>int</type><parameter>source</parameter><initializer>MCRYPT_DEV_RANDOM</initializer></methodparam>
</methodsynopsis>
<para>
Create an initialization vector (IV) from a random source.
Creates an initialization vector (IV) from a random source.
</para>
<para>
The IV is only meant to give an alternative seed to the encryption
@ -98,7 +98,7 @@
&reftitle.examples;
<para>
<example>
<title><function>mcrypt_create_iv</function> example</title>
<title><function>mcrypt_create_iv</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php

View file

@ -27,8 +27,8 @@
<term><parameter>cipher</parameter></term>
<listitem>
<para>
<parameter>cipher</parameter> is one of the MCRYPT_ciphername constants
of the name of the algorithm as string.
One of the <constant>MCRYPT_ciphername</constant> constants,
or the name of the algorithm as string.
</para>
</listitem>
</varlistentry>
@ -36,8 +36,8 @@
<term><parameter>key</parameter></term>
<listitem>
<para>
<parameter>key</parameter> is the key with which the data was encrypted.
If it's smaller than the required keysize, it is padded with
The key with which the data was encrypted. If it's smaller
than the required keysize, it is padded with
'<literal>\0</literal>'.
</para>
</listitem>
@ -46,8 +46,8 @@
<term><parameter>data</parameter></term>
<listitem>
<para>
<parameter>data</parameter> is the data that will be decrypted with
the given cipher and mode. If the size of the data is not n * blocksize,
The data that will be decrypted with the given <parameter>cipher</parameter>
and <parameter>mode</parameter>. If the size of the data is not n * blocksize,
the data will be padded with '<literal>\0</literal>'.
</para>
</listitem>
@ -56,8 +56,9 @@
<term><parameter>mode</parameter></term>
<listitem>
<para>
<parameter>mode</parameter> is one of the MCRYPT_MODE_modename
constants of one of "ecb", "cbc", "cfb", "ofb", "nofb" or "stream".
One of the <constant>MCRYPT_MODE_modename</constant> constants,
or one of the following strings: "ecb", "cbc", "cfb", "ofb",
"nofb" or "stream".
</para>
</listitem>
</varlistentry>
@ -65,10 +66,10 @@
<term><parameter>iv</parameter></term>
<listitem>
<para>
The <parameter>iv</parameter> parameter is used for the initialisation
The <parameter>iv</parameter> parameter is used for the initialization
in CBC, CFB, OFB modes, and in some algorithms in STREAM mode. If you
do not supply an IV, while it is needed for an algorithm, the function
issues a warning and uses an IV with all bytes set to
issues a warning and uses an IV with all its bytes set to
'<literal>\0</literal>'.
</para>
</listitem>

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mcrypt-ecb" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_ecb</refname>
<refpurpose>Deprecated: Encrypt/decrypt data in ECB mode</refpurpose>
<refpurpose>Deprecated: Encrypts/decrypts data in ECB mode</refpurpose>
</refnamediv>
<refsect1 role="description">

View file

@ -35,7 +35,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the size of the IV, or 0 if the IV is ignored in the algorithm.
Returns the size of the IV, or 0 if the IV is ignored by the algorithm.
</para>
</refsect1>
</refentry>

View file

@ -57,9 +57,7 @@
?>
]]>
</programlisting>
<para>
This will print:
</para>
&example.outputs;
<screen>
<![CDATA[
array(3) {

View file

@ -34,7 +34,8 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if the mode outputs blocks of bytes or &false; if it outputs bytes.
Returns &true; if the mode outputs blocks of bytes,
or &false; if it outputs just bytes.
</para>
</refsect1>
</refentry>

View file

@ -29,8 +29,8 @@
<term><parameter>cipher</parameter></term>
<listitem>
<para>
One of the <literal>MCRYPT_ciphername</literal>
constants of the name of the algorithm as string.
One of the <constant>MCRYPT_ciphername</constant>
constants, or the name of the algorithm as string.
</para>
</listitem>
</varlistentry>
@ -52,9 +52,9 @@
<term><parameter>data</parameter></term>
<listitem>
<para>
The data that will be encrypted with the given cipher and mode. If the
size of the data is not n * blocksize, the data will be padded with
'<literal>\0</literal>'.
The data that will be encrypted with the given <parameter>cipher</parameter>
and <parameter>mode</parameter>. If the size of the data is not n * blocksize,
the data will be padded with '<literal>\0</literal>'.
</para>
<para>
The returned crypttext can be larger than the size of the data that was
@ -66,9 +66,9 @@
<term><parameter>mode</parameter></term>
<listitem>
<para>
One of the <literal>MCRYPT_MODE_modename</literal>
constants of one of "ecb", "cbc", "cfb", "ofb", "nofb" or
"stream".
One of the <constant>MCRYPT_MODE_modename</constant> constants,
or one of the following strings: "ecb", "cbc", "cfb", "ofb",
"nofb" or "stream".
</para>
</listitem>
</varlistentry>
@ -76,10 +76,10 @@
<term><parameter>iv</parameter></term>
<listitem>
<para>
Used for the initialisation in CBC, CFB, OFB modes, and in some
Used for the initialization in CBC, CFB, OFB modes, and in some
algorithms in STREAM mode. If you do not supply an IV, while it is
needed for an algorithm, the function issues a warning and uses an
IV with all bytes set to '<literal>\0</literal>'.
IV with all its bytes set to '<literal>\0</literal>'.
</para>
</listitem>
</varlistentry>

View file

@ -61,7 +61,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The function returns a negative value on error, -3 when the key length
The function returns a negative value on error: -3 when the key length
was incorrect, -4 when there was a memory allocation problem and any
other return value is an unknown error. If an error occurs a warning will
be displayed accordingly. &false; is returned if incorrect parameters

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mcrypt-get-block-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_block_size</refname>
<refpurpose>Get the block size of the specified cipher</refpurpose>
<refpurpose>Gets the block size of the specified cipher</refpurpose>
</refnamediv>
<refsect1 role="description">

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mcrypt-get-cipher-name" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_cipher_name</refname>
<refpurpose>Get the name of the specified cipher</refpurpose>
<refpurpose>Gets the name of the specified cipher</refpurpose>
</refnamediv>
<refsect1 role="description">

View file

@ -32,7 +32,7 @@
<term><parameter>cipher</parameter></term>
<listitem>
<para>
One of the <literal>MCRYPT_ciphername</literal> constants of the name
One of the <constant>MCRYPT_ciphername</constant> constants, or the name
of the algorithm as string.
</para>
</listitem>
@ -41,10 +41,10 @@
<term><parameter>mode</parameter></term>
<listitem>
<para>
<parameter>mode</parameter> is one of the MCRYPT_MODE_modename constants
or one of "ecb", "cbc", "cfb", "ofb", "nofb" or "stream". The IV is
ignored in ECB mode as this mode does not require it. You will need to
have the same IV (think: starting point) both at encryption and
One of the <constant>MCRYPT_MODE_modename</constant> constants, or one of
the following strings: "ecb", "cbc", "cfb", "ofb", "nofb" or "stream".
The IV is ignored in ECB mode as this mode does not require it. You will
need to have the same IV (think: starting point) both at encryption and
decryption stages, otherwise your encryption will fail.
</para>
</listitem>
@ -56,7 +56,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the size of the Initialisation Vector (IV) in bytes. On error the
Returns the size of the Initialization Vector (IV) in bytes. On error the
function returns &false;. If the IV is ignored in the specified cipher/mode
combination zero is returned.
</para>
@ -66,7 +66,7 @@
&reftitle.examples;
<para>
<example>
<title><function>mcrypt_get_iv_size</function> example</title>
<title><function>mcrypt_get_iv_size</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mcrypt-get-key-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_key_size</refname>
<refpurpose>Get the key size of the specified cipher</refpurpose>
<refpurpose>Gets the key size of the specified cipher</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -27,32 +27,46 @@
combination with an encryption mode).
</para>
<para>
This example shows how to use this function when linked against libmcrypt
2.4.x and 2.5.x. It is more useful to use the
<function>mcrypt_enc_get_key_size</function> function as this uses the
resource returned by <function>mcrypt_module_open</function>.
It is more useful to use the <function>mcrypt_enc_get_key_size</function>
function as this uses the resource returned by <function>mcrypt_module_open</function>.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mcrypt_get_key_size</function> example</title>
<title><function>mcrypt_get_key_size</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
echo mcrypt_get_key_size('tripledes', 'ecb');
?>
Prints:
24
]]>
</programlisting>
</example>
<para>
The example above shows how to use this function when
linked against libmcrypt 2.4.x or 2.5.x.
</para>
&example.outputs;
<screen>
<![CDATA[
24
]]>
</screen>
</example>
</para>
<para>
See also: <function>mcrypt_get_block_size</function>,
<function>mcrypt_enc_get_key_size</function> and
<function>mcrypt_encrypt</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mcrypt_get_block_size</function></member>
<member><function>mcrypt_enc_get_key_size</function></member>
<member><function>mcrypt_encrypt</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mcrypt-list-algorithms" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_list_algorithms</refname>
<refpurpose>Get an array of all supported ciphers</refpurpose>
<refpurpose>Gets an array of all supported ciphers</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -27,8 +27,8 @@
<listitem>
<para>
Specifies the directory where all algorithms are located. If not
specifies, the value of the mcrypt.algorithms_dir &php.ini; directive
is used.
specified, the value of the <literal>mcrypt.algorithms_dir</literal>
&php.ini; directive is used.
</para>
</listitem>
</varlistentry>
@ -60,7 +60,7 @@
]]>
</programlisting>
<para>
The above example will produce a list with all supported
The example above will produce a list with all supported
algorithms in the "<filename>/usr/local/lib/libmcrypt</filename>" directory.
</para>
</example>

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mcrypt-list-modes" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_list_modes</refname>
<refpurpose>Get an array of all supported modes</refpurpose>
<refpurpose>Gets an array of all supported modes</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -27,7 +27,7 @@
<listitem>
<para>
Specifies the directory where all modes are located. If not
specifies, the value of the <literal>mcrypt.modes_dir</literal>
specified, the value of the <literal>mcrypt.modes_dir</literal>
&php.ini; directive is used.
</para>
</listitem>
@ -60,10 +60,11 @@
]]>
</programlisting>
<para>
The above example will produce a list with all supported
The example above will produce a list with all supported
algorithms in the default mode directory. If it is not set
with the ini directive mcrypt.modes_dir, the default directory
of mcrypt is used (which is <filename>/usr/local/lib/libmcrypt</filename>).
with the <literal>mcrypt.modes_dir</literal> &php.ini;
directive, the default directory of mcrypt is used (which
is <filename>/usr/local/lib/libmcrypt</filename>).
</para>
</example>
</para>

View file

@ -3,7 +3,7 @@
<refentry xml:id='function.mcrypt-module-close' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_close</refname>
<refpurpose>Close the mcrypt module</refpurpose>
<refpurpose>Closes the mcrypt module</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;

View file

@ -28,7 +28,7 @@
<term><parameter>algorithm</parameter></term>
<listitem>
<para>
The algorithm to used.
The algorithm to be used.
</para>
</listitem>
</varlistentry>
@ -37,7 +37,7 @@
<listitem>
<para>
The optional <parameter>lib_dir</parameter> parameter can contain the
location of where the algorithm module is on the system.
location where the algorithm module is on the system.
</para>
</listitem>
</varlistentry>

View file

@ -36,7 +36,7 @@
<listitem>
<para>
The optional <parameter>lib_dir</parameter> parameter can contain the
location of where the algorithm module is on the system.
location where the algorithm module is on the system.
</para>
</listitem>
</varlistentry>

View file

@ -15,7 +15,7 @@
</methodsynopsis>
<para>
This function returns &true; if the specified algorithm is a block
algorithm, or &false; is it is a stream algorithm.
algorithm, or &false; if it is a stream one.
</para>
</refsect1>
@ -36,7 +36,7 @@
<listitem>
<para>
The optional <parameter>lib_dir</parameter> parameter can contain the
location of where the algorithm module is on the system.
location where the algorithm module is on the system.
</para>
</listitem>
</varlistentry>
@ -48,7 +48,7 @@
&reftitle.returnvalues;
<para>
This function returns &true; if the specified algorithm is a block
algorithm, or &false; is it is a stream algorithm.
algorithm, or &false; if it is a stream one.
</para>
</refsect1>
</refentry>

View file

@ -37,7 +37,7 @@
<listitem>
<para>
The optional <parameter>lib_dir</parameter> parameter can contain the
location of where the algorithm module is on the system.
location where the algorithm module is on the system.
</para>
</listitem>
</varlistentry>

View file

@ -39,15 +39,12 @@
<term><parameter>algorithm_directory</parameter></term>
<listitem>
<para>
The <parameter>algorithm_directory</parameter> and
<parameter>mode_directory</parameter> are used to locate the encryption
modules. When you supply a directory name, it is used. When you set one
of these to the empty string (<literal>""</literal>), the value set by
the <parameter>mcrypt.algorithms_dir</parameter> or
<parameter>mcrypt.modes_dir</parameter> ini-directive is used. When
these are not set, the default directories that are used are the ones
that were compiled in into libmcrypt (usually
<filename>/usr/local/lib/libmcrypt</filename>).
The <parameter>algorithm_directory</parameter> parameter is used to locate
the encryption module. When you supply a directory name, it is used. When
you set it to an empty string (<literal>""</literal>), the value set by the
<literal>mcrypt.algorithms_dir</literal> &php.ini; directive is used. When
it is not set, the default directory that is used is the one that was compiled
into libmcrypt (usually <filename>/usr/local/lib/libmcrypt</filename>).
</para>
</listitem>
</varlistentry>
@ -63,6 +60,12 @@
<term><parameter>mode_directory</parameter></term>
<listitem>
<para>
The <parameter>mode_directory</parameter> parameter is used to locate
the encryption module. When you supply a directory name, it is used. When
you set it to an empty string (<literal>""</literal>), the value set by the
<literal>mcrypt.modes_dir</literal> &php.ini; directive is used. When
it is not set, the default directory that is used is the one that was compiled-in
into libmcrypt (usually <filename>/usr/local/lib/libmcrypt</filename>).
</para>
</listitem>
</varlistentry>
@ -81,7 +84,7 @@
&reftitle.examples;
<para>
<example>
<title><function>mcrypt_module_open</function> examples</title>
<title><function>mcrypt_module_open</function> Examples</title>
<programlisting role="php">
<![CDATA[
<?php

View file

@ -35,7 +35,7 @@
<listitem>
<para>
The optional <parameter>lib_dir</parameter> parameter can contain the
location of where the algorithm module is on the system.
location where the algorithm module is on the system.
</para>
</listitem>
</varlistentry>
@ -46,7 +46,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The function returns &true; if the self test succeeds, or &false; when if
The function returns &true; if the self test succeeds, or &false; when it
fails.
</para>
</refsect1>

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mcrypt-ofb" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_ofb</refname>
<refpurpose>Encrypt/decrypt data in OFB mode</refpurpose>
<refpurpose>Encrypts/decrypts data in OFB mode</refpurpose>
</refnamediv>
<refsect1 role="description">

View file

@ -3,7 +3,7 @@
<refentry xml:id="function.mdecrypt-generic" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mdecrypt_generic</refname>
<refpurpose>Decrypt data</refpurpose>
<refpurpose>Decrypts data</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -15,7 +15,7 @@
</methodsynopsis>
<para>
This function decrypts data. Note that the length of the returned string
can in fact be longer then the unencrypted string, due to the padding of
can in fact be longer than the unencrypted string, due to the padding of
the data.
</para>
</refsect1>
@ -49,7 +49,7 @@
&reftitle.examples;
<para>
<example>
<title><function>mdecrypt_generic</function> example</title>
<title><function>mdecrypt_generic</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -90,7 +90,7 @@
</example>
</para>
<para>
The above example shows how to check if the data before the encryption is
The example above shows how to check if the data before the encryption is
the same as the data after the decryption. It is very important to
reinitialize the encryption buffer with
<function>mcrypt_generic_init</function> before you try to decrypt the