mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
psa: cipher: Remove cipher_generate_iv driver entry point
Remove cipher_generate_iv driver entry point as there is no known use case to delegate this to a driver. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
@ -260,24 +260,6 @@ static psa_status_t cipher_set_iv( mbedtls_psa_cipher_operation_t *operation,
|
||||
iv, iv_length ) ) );
|
||||
}
|
||||
|
||||
static psa_status_t cipher_generate_iv(
|
||||
mbedtls_psa_cipher_operation_t *operation,
|
||||
uint8_t *iv, size_t iv_size, size_t *iv_length )
|
||||
{
|
||||
int status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||
|
||||
if( iv_size < operation->iv_length )
|
||||
return( PSA_ERROR_BUFFER_TOO_SMALL );
|
||||
|
||||
status = psa_generate_random( iv, operation->iv_length );
|
||||
if( status != PSA_SUCCESS )
|
||||
return( status );
|
||||
|
||||
*iv_length = operation->iv_length;
|
||||
|
||||
return( cipher_set_iv( operation, iv, *iv_length ) );
|
||||
}
|
||||
|
||||
/* Process input for which the algorithm is set to ECB mode. This requires
|
||||
* manual processing, since the PSA API is defined as being able to process
|
||||
* arbitrary-length calls to psa_cipher_update() with ECB mode, but the
|
||||
@ -489,13 +471,6 @@ psa_status_t mbedtls_psa_cipher_decrypt_setup(
|
||||
operation, attributes, key_buffer, key_buffer_size, alg ) );
|
||||
}
|
||||
|
||||
psa_status_t mbedtls_psa_cipher_generate_iv(
|
||||
mbedtls_psa_cipher_operation_t *operation,
|
||||
uint8_t *iv, size_t iv_size, size_t *iv_length )
|
||||
{
|
||||
return( cipher_generate_iv( operation, iv, iv_size, iv_length ) );
|
||||
}
|
||||
|
||||
psa_status_t mbedtls_psa_cipher_set_iv( mbedtls_psa_cipher_operation_t *operation,
|
||||
const uint8_t *iv,
|
||||
size_t iv_length )
|
||||
@ -553,13 +528,6 @@ psa_status_t mbedtls_transparent_test_driver_cipher_decrypt_setup(
|
||||
operation, attributes, key_buffer, key_buffer_size, alg ) );
|
||||
}
|
||||
|
||||
psa_status_t mbedtls_transparent_test_driver_cipher_generate_iv(
|
||||
mbedtls_psa_cipher_operation_t *operation,
|
||||
uint8_t *iv, size_t iv_size, size_t *iv_length )
|
||||
{
|
||||
return( cipher_generate_iv( operation, iv, iv_size, iv_length ) );
|
||||
}
|
||||
|
||||
psa_status_t mbedtls_transparent_test_driver_cipher_set_iv(
|
||||
mbedtls_psa_cipher_operation_t *operation,
|
||||
const uint8_t *iv, size_t iv_length )
|
||||
|
Reference in New Issue
Block a user