<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.sodium.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.sodium-crypto-secretstream-xchacha20poly1305-push.php',
    1 => 'sodium_crypto_secretstream_xchacha20poly1305_push',
    2 => 'Encrypt a chunk of data so that it can safely be decrypted in a streaming API',
  ),
  'up' => 
  array (
    0 => 'ref.sodium.php',
    1 => 'Sodium Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.sodium-crypto-secretstream-xchacha20poly1305-pull.php',
    1 => 'sodium_crypto_secretstream_xchacha20poly1305_pull',
  ),
  'next' => 
  array (
    0 => 'function.sodium-crypto-secretstream-xchacha20poly1305-rekey.php',
    1 => 'sodium_crypto_secretstream_xchacha20poly1305_rekey',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/sodium/functions/sodium-crypto-secretstream-xchacha20poly1305-push.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.sodium-crypto-secretstream-xchacha20poly1305-push" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">sodium_crypto_secretstream_xchacha20poly1305_push</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.2.0, PHP 8)</p><p class="refpurpose"><span class="refname">sodium_crypto_secretstream_xchacha20poly1305_push</span> &mdash; <span class="dc-title">Encrypt a chunk of data so that it can safely be decrypted in a streaming API</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.sodium-crypto-secretstream-xchacha20poly1305-push-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>sodium_crypto_secretstream_xchacha20poly1305_push</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter reference">&$state</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="attribute"><a href="class.sensitiveparameter.php">#[\SensitiveParameter]</a> </span><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$message</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$additional_data</code><span class="initializer"> = &quot;&quot;</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$tag</code><span class="initializer"> = <strong><code><a href="sodium.constants.php#constant.sodium-crypto-secretstream-xchacha20poly1305-tag-message">SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE</a></code></strong></span></span><br>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="simpara">
   Encrypt a chunk of data so that it can safely be decrypted in a streaming API.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.sodium-crypto-secretstream-xchacha20poly1305-push-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <dl>
   
    <dt><code class="parameter">state</code></dt>
    <dd>
     <span class="simpara">
      See <span class="function"><a href="function.sodium-crypto-secretstream-xchacha20poly1305-init-pull.php" class="function">sodium_crypto_secretstream_xchacha20poly1305_init_pull()</a></span>
      and <span class="function"><a href="function.sodium-crypto-secretstream-xchacha20poly1305-init-push.php" class="function">sodium_crypto_secretstream_xchacha20poly1305_init_push()</a></span>
     </span>
    </dd>
   
   
    <dt><code class="parameter">message</code></dt>
    <dd>
     <span class="simpara">

     </span>
    </dd>
   
   
    <dt><code class="parameter">additional_data</code></dt>
    <dd>
     <span class="simpara">

     </span>
    </dd>
   
   
    <dt><code class="parameter">tag</code></dt>
    <dd>
     <span class="simpara">
      Optional. Can be used to assert decryption behavior
      (i.e. re-keying or indicating the final chunk in a stream).
     </span>
     <ul class="simplelist">
      <li>
       <strong><code><a href="sodium.constants.php#constant.sodium-crypto-secretstream-xchacha20poly1305-tag-message">SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE</a></code></strong>:
       the most common tag, that doesn't add any information about the nature of the message.
      </li>
      <li>
       <strong><code><a href="sodium.constants.php#constant.sodium-crypto-secretstream-xchacha20poly1305-tag-final">SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL</a></code></strong>:
       indicates that the message marks the end of the stream, and erases the secret key used to encrypt the previous sequence.
      </li>
      <li>
       <strong><code><a href="sodium.constants.php#constant.sodium-crypto-secretstream-xchacha20poly1305-tag-push">SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH</a></code></strong>:
       indicates that the message marks the end of a set of messages, but not the end of the stream.
       For example, a huge JSON string sent as multiple chunks can use this tag to indicate to the application that the
       string is complete and that it can be decoded. But the stream itself is not closed, and more data may follow.
      </li>
      <li>
       <strong><code><a href="sodium.constants.php#constant.sodium-crypto-secretstream-xchacha20poly1305-tag-rekey">SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY</a></code></strong>:
       "forget" the key used to encrypt this message and the previous ones, and derive a new secret key.
      </li>
     </ul>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.sodium-crypto-secretstream-xchacha20poly1305-push-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="simpara">
   Returns the encrypted ciphertext.
  </p>
 </div>



</div><?php manual_footer($setup); ?>