sodium_crypto_secretstream_xchacha20poly1305_push
Function  • Misc changes in PHP 8.2  
Encrypt a chunk of data so that it can safely be decrypted in a streaming API.
sodium_crypto_secretstream_xchacha20poly1305_push Function synopsis
sodium_crypto_secretstream_xchacha20poly1305_push(
    string &$state,
    string $message,
    string $additional_data = "",
    int $tag = SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE
  ): stringParameters
$state 
Passed by referenceTypestring
See sodium_crypto_secretstream_xchacha20poly1305_init_pull
and sodium_crypto_secretstream_xchacha20poly1305_init_push
$message 
Typestring
$additional_data 
OptionalTypestringDefault value""
$tag 
OptionalTypeintDefault valueSODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE
Optional. Can be used to assert decryption behavior (i.e. re-keying or indicating the final chunk in a stream).
Note that the parameter
$stateis passed by reference, and contains additional/updated context data that may be useful.
Return value
Typestring
Returns the encrypted ciphertext.
Changes to the sodium_crypto_secretstream_xchacha20poly1305_push Function 
PHP 8.2
- Attribute added for parameter $message:#[SensitiveParameter]
PHP 8.0
- Return type added: string
- Parameter type added for parameter #1 ($state):string
- Parameter name of parameter #2 changed: $stringto$message
- Parameter type added for parameter #2 ($message):string
- Parameter name of parameter #3 changed: $stringto$additional_data
- Parameter type added for parameter #3 ($additional_data):string
- Parameter default value added for position #3 ($additional_data):""
- Parameter name of parameter #4 changed: $longto$tag
- Parameter type added for parameter #4 ($tag):int
- Parameter default value added for position #4 ($tag):SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE
  sodium_crypto_secretstream_xchacha20poly1305_push(
-     &$state,
+     string &$state,
-     $string,
+     string $message,
-     $string,
+     string $additional_data = "",
-     $long
+     int $tag = SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE
-   )
+   ): stringPHP 7.2
- Function added
sodium_crypto_secretstream_xchacha20poly1305_push Function Availability
sodium_crypto_secretstream_xchacha20poly1305_push Function Availability| PHP Version | Availability | 
|---|---|
| PHP 8.6Future Release | Yes | 
| PHP 8.5Upcoming Release | Yes | 
| PHP 8.4Supported (Latest) | Yes | 
| PHP 8.3Supported | Yes | 
| PHP 8.2Security-Fixes Only | Yes | 
| PHP 8.1Security-Fixes Only | Yes | 
| PHP 8.0Unsupported | Yes | 
| PHP 7.4Unsupported | Yes | 
| PHP 7.3Unsupported | Yes | 
| PHP 7.2Unsupported | Yes | 
| PHP 7.1Unsupported | No | 
| PHP 7.0Unsupported | No | 
| PHP 5.6Unsupported | No | 
| PHP 5.5Unsupported | No | 
| PHP 5.4Unsupported | No | 
| PHP 5.3Unsupported | No |