mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Simplify psa_key_derivation_input_bytes
The specific key derivation input functions support a subset of the input options and need to check it anyway. Checking it at the top level is redundant, it brings a very little value and comes with a cost in code size and maintainability.
This commit is contained in:
@ -4851,17 +4851,11 @@ psa_status_t psa_key_derivation_input_bytes( psa_key_derivation_operation_t *ope
|
|||||||
const uint8_t *data,
|
const uint8_t *data,
|
||||||
size_t data_length )
|
size_t data_length )
|
||||||
{
|
{
|
||||||
switch( step )
|
if( step == PSA_KEY_DERIVATION_INPUT_SECRET )
|
||||||
{
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
case PSA_KEY_DERIVATION_INPUT_LABEL:
|
|
||||||
case PSA_KEY_DERIVATION_INPUT_SALT:
|
return( psa_key_derivation_input_internal( operation, step,
|
||||||
case PSA_KEY_DERIVATION_INPUT_INFO:
|
data, data_length ) );
|
||||||
case PSA_KEY_DERIVATION_INPUT_SEED:
|
|
||||||
return( psa_key_derivation_input_internal( operation, step,
|
|
||||||
data, data_length ) );
|
|
||||||
default:
|
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
psa_status_t psa_key_derivation_input_key( psa_key_derivation_operation_t *operation,
|
psa_status_t psa_key_derivation_input_key( psa_key_derivation_operation_t *operation,
|
||||||
|
Reference in New Issue
Block a user