sodium_crypto_kdf_derive_from_key
Function • Params and return types changed in PHP 8.0
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.0
- Return type added:
string
- Parameter name of parameter #1 changed:
$subkey_len
to$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 AvailabilityPHP Version | Availability |
---|---|
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 |