sodium_crypto_kdf_derive_from_key
Function • Misc changes in PHP 8.2
Derive a subkey.
sodium_crypto_kdf_derive_from_key Function synopsis
sodium_crypto_kdf_derive_from_key(
int $subkey_length,
int $subkey_id,
string $context,
string $key
): string
Parameters
$subkey_length
Typeint
Length of the key to return (in bytes)
$subkey_id
Typeint
Return the Nth subkey from a given root key. Useful for seeking.
$context
Typestring
Application-specific context.
$key
Typestring
The root key from which the subkey is derived.
Return value
Typestring
A string of pseudorandom (raw binary) bytes.
Changes to the sodium_crypto_kdf_derive_from_key Function
PHP 8.2
- Attribute added for parameter
$key:#[SensitiveParameter]
PHP 8.0
- Return type added:
string - Parameter name of parameter #1 changed:
$subkey_lento$subkey_length - Parameter type added for parameter #1 (
$subkey_length):int - Parameter type added for parameter #2 (
$subkey_id):int - Parameter type added for parameter #3 (
$context):string - Parameter type added for parameter #4 (
$key):string
sodium_crypto_kdf_derive_from_key(
- $subkey_len,
+ int $subkey_length,
- $subkey_id,
+ int $subkey_id,
- $context,
+ string $context,
- $key
+ string $key
- )
+ ): string PHP 7.2
- Function added
sodium_crypto_kdf_derive_from_key Function Availability
sodium_crypto_kdf_derive_from_key Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | 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 |