add ecb to cipher algorithms

This commit is contained in:
mohammad1603 2018-03-14 15:15:33 +02:00 committed by itayzafrir
parent cdd3be9cfb
commit 990a18c2f0
2 changed files with 4 additions and 2 deletions

View File

@ -317,6 +317,7 @@ typedef uint32_t psa_algorithm_t;
#define PSA_ALG_CFB_BASE ((psa_algorithm_t)0x04000002)
#define PSA_ALG_OFB_BASE ((psa_algorithm_t)0x04000003)
#define PSA_ALG_XTS_BASE ((psa_algorithm_t)0x04000004)
#define PSA_ALG_ECB_BASE ((psa_algorithm_t)0x04000005)
#define PSA_ALG_STREAM_CIPHER ((psa_algorithm_t)0x04800000)
#define PSA_ALG_CTR ((psa_algorithm_t)0x04800001)
#define PSA_ALG_ARC4 ((psa_algorithm_t)0x04800002)

View File

@ -880,13 +880,14 @@ static const mbedtls_cipher_info_t *mbedtls_cipher_info_from_psa(
if( PSA_ALG_IS_CIPHER( alg ) || PSA_ALG_IS_AEAD( alg ) )
{
if( PSA_ALG_IS_BLOCK_CIPHER( alg ) )
alg &= ~PSA_ALG_BLOCK_CIPHER_MODE_MASK;
switch( alg )
{
case PSA_ALG_STREAM_CIPHER:
mode = MBEDTLS_MODE_STREAM;
break;
case PSA_ALG_ECB_BASE:
mode = MBEDTLS_MODE_ECB;
break;
case PSA_ALG_CBC_BASE:
mode = MBEDTLS_MODE_CBC;
break;