mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 23:45:42 +01:00
Add PSA support for MBEDTLS_CIPHER_AES_128_ECB
Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
6c866689e3
commit
f0fa86eee5
@ -59,6 +59,7 @@ static inline psa_key_type_t mbedtls_psa_translate_cipher_type(
|
||||
case MBEDTLS_CIPHER_AES_128_CBC:
|
||||
case MBEDTLS_CIPHER_AES_192_CBC:
|
||||
case MBEDTLS_CIPHER_AES_256_CBC:
|
||||
case MBEDTLS_CIPHER_AES_128_ECB:
|
||||
return( PSA_KEY_TYPE_AES );
|
||||
|
||||
/* ARIA not yet supported in PSA. */
|
||||
|
@ -1246,9 +1246,12 @@ int mbedtls_cipher_crypt( mbedtls_cipher_context_t *ctx,
|
||||
if( status != PSA_SUCCESS )
|
||||
return( MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED );
|
||||
|
||||
status = psa_cipher_set_iv( &cipher_op, iv, iv_len );
|
||||
if( status != PSA_SUCCESS )
|
||||
return( MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED );
|
||||
if( ctx->cipher_info->mode != MBEDTLS_MODE_ECB )
|
||||
{
|
||||
status = psa_cipher_set_iv( &cipher_op, iv, iv_len );
|
||||
if( status != PSA_SUCCESS )
|
||||
return( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
|
||||
}
|
||||
|
||||
status = psa_cipher_update( &cipher_op,
|
||||
input, ilen,
|
||||
|
Loading…
Reference in New Issue
Block a user