mirror of
				https://github.com/Mbed-TLS/mbedtls.git
				synced 2025-10-30 10:45:34 +03:00 
			
		
		
		
	Fix codestyle in psa iop key agreement driver wrapper APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
This commit is contained in:
		| @@ -2702,7 +2702,7 @@ static inline psa_status_t psa_driver_wrapper_key_agreement( | |||||||
| } | } | ||||||
|  |  | ||||||
| static inline uint32_t psa_driver_wrapper_key_agreement_get_num_ops( | static inline uint32_t psa_driver_wrapper_key_agreement_get_num_ops( | ||||||
|     psa_key_agreement_iop_t *operation) |     psa_key_agreement_iop_t *operation ) | ||||||
| { | { | ||||||
|     switch( operation->id ) |     switch( operation->id ) | ||||||
|     { |     { | ||||||
| @@ -2711,10 +2711,12 @@ static inline uint32_t psa_driver_wrapper_key_agreement_get_num_ops( | |||||||
|             return 0; |             return 0; | ||||||
|  |  | ||||||
|         case PSA_CRYPTO_MBED_TLS_DRIVER_ID: |         case PSA_CRYPTO_MBED_TLS_DRIVER_ID: | ||||||
|             return(mbedtls_psa_key_agreement_get_num_ops(&operation->ctx.mbedtls_ctx)); |             return( mbedtls_psa_key_agreement_get_num_ops( &operation->ctx.mbedtls_ctx ) ); | ||||||
|  |  | ||||||
| #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT) | #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT) | ||||||
|  |  | ||||||
|  |     /* Add cases for drivers here */ | ||||||
|  |  | ||||||
| #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */ | #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */ | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -2727,7 +2729,7 @@ static inline psa_status_t psa_driver_wrapper_key_agreement_setup( | |||||||
|     size_t private_key_buffer_len, |     size_t private_key_buffer_len, | ||||||
|     const uint8_t *peer_key, |     const uint8_t *peer_key, | ||||||
|     size_t peer_key_length, |     size_t peer_key_length, | ||||||
|     const psa_key_attributes_t *attributes) |     const psa_key_attributes_t *attributes ) | ||||||
| { | { | ||||||
|     psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; |     psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; | ||||||
|     psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION( |     psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION( | ||||||
| @@ -2741,15 +2743,16 @@ static inline psa_status_t psa_driver_wrapper_key_agreement_setup( | |||||||
|  |  | ||||||
| #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT) | #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT) | ||||||
|  |  | ||||||
|  |     /* Add cases for drivers here */ | ||||||
|  |  | ||||||
| #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */ | #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */ | ||||||
|  |  | ||||||
|             /* Fell through, meaning no accelerator supports this operation */ |             /* Fell through, meaning no accelerator supports this operation */ | ||||||
|             operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID; |             operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID; | ||||||
|             status = mbedtls_psa_key_agreement_setup(&operation->ctx.mbedtls_ctx, private_key_buffer, |             status = mbedtls_psa_key_agreement_setup( &operation->ctx.mbedtls_ctx, private_key_buffer, | ||||||
|                                                       private_key_buffer_len, peer_key, |                                                       private_key_buffer_len, peer_key, | ||||||
|                                                       peer_key_length, |                                                       peer_key_length, | ||||||
|                                                     attributes); |                                                       attributes ); | ||||||
|             break; |             break; | ||||||
|  |  | ||||||
|             /* Add cases for opaque driver here */ |             /* Add cases for opaque driver here */ | ||||||
| @@ -2773,13 +2776,14 @@ static inline psa_status_t psa_driver_wrapper_key_agreement_complete( | |||||||
|     switch( operation->id ) |     switch( operation->id ) | ||||||
|     { |     { | ||||||
|         case PSA_CRYPTO_MBED_TLS_DRIVER_ID: |         case PSA_CRYPTO_MBED_TLS_DRIVER_ID: | ||||||
|             status = mbedtls_psa_key_agreement_complete(&operation->ctx.mbedtls_ctx, shared_secret, |             status = mbedtls_psa_key_agreement_complete( &operation->ctx.mbedtls_ctx, shared_secret, | ||||||
|                                                          shared_secret_size, |                                                          shared_secret_size, | ||||||
|                                                         shared_secret_length); |                                                          shared_secret_length ); | ||||||
|             break; |             break; | ||||||
|  |  | ||||||
| #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT) | #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT) | ||||||
|  |  | ||||||
|  |     /* Add cases for drivers here */ | ||||||
|  |  | ||||||
| #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */ | #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */ | ||||||
|         default: |         default: | ||||||
| @@ -2796,11 +2800,12 @@ static inline psa_status_t psa_driver_wrapper_key_agreement_abort( | |||||||
|     switch( operation->id ) |     switch( operation->id ) | ||||||
|     { |     { | ||||||
|         case PSA_CRYPTO_MBED_TLS_DRIVER_ID: |         case PSA_CRYPTO_MBED_TLS_DRIVER_ID: | ||||||
|             status = mbedtls_psa_key_agreement_abort(&operation->ctx.mbedtls_ctx); |             status = mbedtls_psa_key_agreement_abort( &operation->ctx.mbedtls_ctx ); | ||||||
|             break; |             break; | ||||||
|  |  | ||||||
| #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT) | #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT) | ||||||
|  |  | ||||||
|  |     /* Add cases for drivers here */ | ||||||
|  |  | ||||||
| #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */ | #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */ | ||||||
|         default: |         default: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user