php-doc-en/reference/sodium/functions/sodium-crypto-aead-chacha20poly1305-ietf-decrypt.xml
Paragon Initiative Enterprises 14e3e35ca0
Provide documentation for many ext/sodium functions
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-592.
2021-06-04 13:10:30 +02:00

95 lines
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="function.sodium-crypto-aead-chacha20poly1305-ietf-decrypt">
<refnamediv>
<refname>sodium_crypto_aead_chacha20poly1305_ietf_decrypt</refname>
<refpurpose>Verify that the ciphertext includes a valid tag</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>string</type><type>false</type></type><methodname>sodium_crypto_aead_chacha20poly1305_ietf_decrypt</methodname>
<methodparam><type>string</type><parameter>ciphertext</parameter></methodparam>
<methodparam><type>string</type><parameter>additional_data</parameter></methodparam>
<methodparam><type>string</type><parameter>nonce</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
</methodsynopsis>
<para>
Verify then decrypt with ChaCha20-Poly1305 (IETF variant).
</para>
<para>
The IETF variant uses 96-bit nonces and 32-bit internal counters, instead of 64-bit for both.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>ciphertext</parameter></term>
<listitem>
<para>
Must be in the format provided by <function>sodium_crypto_aead_chacha20poly1305_ietf_encrypt</function>
(ciphertext and tag, concatenated).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>additional_data</parameter></term>
<listitem>
<para>
Additional, authenticated data. This is used in the verification of the authentication tag
appended to the ciphertext, but it is not encrypted or stored in the ciphertext.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>nonce</parameter></term>
<listitem>
<para>
A number that must be only used once, per message. 12 bytes long.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
Encryption key (256-bit).
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the plaintext on success, &return.falseforfailure;.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->