@@ -280,6 +280,20 @@ psa_status_t psa_driver_wrapper_sign_hash(
280280 * cycle through all known transparent accelerators */
281281#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT )
282282#if defined(PSA_CRYPTO_DRIVER_CC3XX )
283+ /* Do not call the cc3xx_sign_hash for RSA keys since it still in early development */
284+ if (PSA_KEY_TYPE_IS_RSA (attributes -> core .type )){
285+ return ( psa_sign_hash_builtin ( attributes ,
286+ key_buffer ,
287+ key_buffer_size ,
288+ alg ,
289+ hash ,
290+ hash_length ,
291+ signature ,
292+ signature_size ,
293+ signature_length ) );
294+
295+ }
296+
283297 status = cc3xx_sign_hash ( attributes ,
284298 key_buffer ,
285299 key_buffer_size ,
@@ -393,6 +407,17 @@ psa_status_t psa_driver_wrapper_verify_hash(
393407 * cycle through all known transparent accelerators */
394408#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT )
395409#if defined(PSA_CRYPTO_DRIVER_CC3XX )
410+ /* Do not call the cc3xx_verify_hash for RSA keys since it still in early development */
411+ if (PSA_KEY_TYPE_IS_RSA (attributes -> core .type )){
412+ return ( psa_verify_hash_builtin ( attributes ,
413+ key_buffer ,
414+ key_buffer_size ,
415+ alg ,
416+ hash ,
417+ hash_length ,
418+ signature ,
419+ signature_length ) );
420+ }
396421
397422 status = cc3xx_verify_hash ( attributes ,
398423 key_buffer ,
@@ -725,6 +750,15 @@ psa_status_t psa_driver_wrapper_import_key(
725750 case PSA_KEY_LOCATION_LOCAL_STORAGE :
726751 /* Key is stored in the slot in export representation, so
727752 * cycle through all known transparent accelerators */
753+
754+ /* RSA are not fully supported yet in the PSA drivers. This is a workaround
755+ * to make sure that only the builtin solution is being used. */
756+ if (PSA_KEY_TYPE_IS_RSA (attributes -> core .type )){
757+ return ( psa_import_key_into_slot ( attributes ,
758+ data , data_length ,
759+ key_buffer , key_buffer_size ,
760+ key_buffer_length , bits ) );
761+ }
728762#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT )
729763#if defined(PSA_CRYPTO_DRIVER_TEST )
730764 status = mbedtls_test_transparent_import_key (
@@ -874,6 +908,17 @@ psa_status_t psa_driver_wrapper_export_public_key(
874908 case PSA_KEY_LOCATION_LOCAL_STORAGE :
875909 /* Key is stored in the slot in export representation, so
876910 * cycle through all known transparent accelerators */
911+
912+ /* RSA are not fully supported yet in the PSA drivers. This is a workaround
913+ * to make sure that only the builtin solution is being used. */
914+ if (PSA_KEY_TYPE_IS_RSA (attributes -> core .type )){
915+ return ( psa_export_public_key_internal ( attributes ,
916+ key_buffer ,
917+ key_buffer_size ,
918+ data ,
919+ data_size ,
920+ data_length ) );
921+ }
877922#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT )
878923#if defined(PSA_CRYPTO_DRIVER_CC3XX )
879924 status = cc3xx_export_public_key (
0 commit comments