sodium_crypto_secretstream_xchacha20poly1305_pull

FunctionParams and return types changed in PHP 8.0

Decrypt a chunk of data from an encrypted stream.

PHP 5
PHP 7.0-7.1
PHP 7.2
Added
PHP 7.3-7.4
PHP 8.0
Improved
PHP 8.1
PHP 8.2
PHP 8.3
PHP 8.4
PHP 8.5

sodium_crypto_secretstream_xchacha20poly1305_pull Function synopsis

sodium_crypto_secretstream_xchacha20poly1305_pull(
    string &$state,
    string $ciphertext,
    string $additional_data = ""
  ): array|false

Parameters

$state

Passed by referenceTypestring

See sodium_crypto_secretstream_xchacha20poly1305_init_pull and sodium_crypto_secretstream_xchacha20poly1305_init_push

$ciphertext

Typestring

The ciphertext chunk to decrypt.

$additional_data

OptionalTypestringDefault value""

Optional additional data to include in the authentication tag.

Note that the parameter $state is passed by reference, and contains additional/updated context data that may be useful.

Return value

Typearray|false

An array with two values:

  `string`; The decrypted chunk

  `int`; An optional tag (if provided during push). Possible values:

Changes to the sodium_crypto_secretstream_xchacha20poly1305_pull Function

PHP 8.0

  • Return type added: array|false
  • Parameter type added for parameter #1 ($state): string
  • Parameter name of parameter #2 changed: $string to $ciphertext
  • Parameter type added for parameter #2 ($ciphertext): string
  • Parameter name of parameter #3 changed: $string to $additional_data
  • Parameter type added for parameter #3 ($additional_data): string
  • Parameter default value added for position #3 ($additional_data): ""
  sodium_crypto_secretstream_xchacha20poly1305_pull(
-     &$state,
+     string &$state,
-     $string,
+     string $ciphertext,
-     $string
+     string $additional_data = ""
-   )
+   ): array|false

PHP 7.2

  • Function added

sodium_crypto_secretstream_xchacha20poly1305_pull Function Availability

PHP VersionAvailability
PHP 8.5Future Release Yes
PHP 8.4Upcoming Release Yes
PHP 8.3Supported (Latest) Yes
PHP 8.2Supported 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