/mbedtls-latest/library/ |
D | psa_crypto.c | 203 status = psa_crypto_local_input_alloc(input, length, \ 205 if (status != PSA_SUCCESS) { \ 245 status = psa_crypto_local_output_alloc(output, length, \ 247 if (status != PSA_SUCCESS) { \ 269 status = local_output_status; \ 595 static void psa_wipe_tag_output_buffer(uint8_t *output_buffer, psa_status_t status, in psa_wipe_tag_output_buffer() argument 606 if (status == PSA_SUCCESS) { in psa_wipe_tag_output_buffer() 736 psa_status_t status = psa_allocate_buffer_to_slot(slot, in psa_copy_key_material_into_slot() local 738 if (status != PSA_SUCCESS) { in psa_copy_key_material_into_slot() 739 return status; in psa_copy_key_material_into_slot() [all …]
|
D | psa_crypto_driver_wrappers.h | 103 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_driver_wrapper_init() local 106 status = tfm_builtin_key_loader_init(); in psa_driver_wrapper_init() 107 if (status != PSA_SUCCESS) in psa_driver_wrapper_init() 108 return ( status ); in psa_driver_wrapper_init() 112 status = psa_init_all_se_drivers( ); in psa_driver_wrapper_init() 113 if( status != PSA_SUCCESS ) in psa_driver_wrapper_init() 114 return( status ); in psa_driver_wrapper_init() 118 status = mbedtls_test_transparent_init( ); in psa_driver_wrapper_init() 119 if( status != PSA_SUCCESS ) in psa_driver_wrapper_init() 120 return( status ); in psa_driver_wrapper_init() [all …]
|
D | psa_crypto_ecp.c | 96 psa_status_t status; in mbedtls_psa_ecp_load_representation() local 140 status = check_ecc_parameters(PSA_KEY_TYPE_ECC_GET_FAMILY(type), &curve_bits); in mbedtls_psa_ecp_load_representation() 141 if (status != PSA_SUCCESS) { in mbedtls_psa_ecp_load_representation() 149 status = PSA_ERROR_NOT_SUPPORTED; in mbedtls_psa_ecp_load_representation() 153 status = mbedtls_to_psa_error( in mbedtls_psa_ecp_load_representation() 155 if (status != PSA_SUCCESS) { in mbedtls_psa_ecp_load_representation() 162 status = mbedtls_to_psa_error( in mbedtls_psa_ecp_load_representation() 166 if (status != PSA_SUCCESS) { in mbedtls_psa_ecp_load_representation() 171 status = mbedtls_to_psa_error( in mbedtls_psa_ecp_load_representation() 173 if (status != PSA_SUCCESS) { in mbedtls_psa_ecp_load_representation() [all …]
|
D | psa_crypto_slot_management.c | 386 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_get_and_lock_key_slot_in_memory() local 399 status = PSA_SUCCESS; in psa_get_and_lock_key_slot_in_memory() 401 status = PSA_ERROR_DOES_NOT_EXIST; in psa_get_and_lock_key_slot_in_memory() 416 status = (slot_idx < MBEDTLS_PSA_KEY_SLOT_COUNT) ? in psa_get_and_lock_key_slot_in_memory() 420 if (status == PSA_SUCCESS) { in psa_get_and_lock_key_slot_in_memory() 421 status = psa_register_read(slot); in psa_get_and_lock_key_slot_in_memory() 422 if (status == PSA_SUCCESS) { in psa_get_and_lock_key_slot_in_memory() 427 return status; in psa_get_and_lock_key_slot_in_memory() 537 psa_status_t status = psa_key_slot_state_transition(slot, in psa_allocate_volatile_key_slot() local 540 if (status != PSA_SUCCESS) { in psa_allocate_volatile_key_slot() [all …]
|
D | psa_crypto_rsa.c | 46 psa_status_t status; in psa_check_rsa_key_byte_aligned() local 48 status = mbedtls_to_psa_error( in psa_check_rsa_key_byte_aligned() 50 if (status == PSA_SUCCESS) { in psa_check_rsa_key_byte_aligned() 52 status = PSA_ERROR_NOT_SUPPORTED; in psa_check_rsa_key_byte_aligned() 56 return status; in psa_check_rsa_key_byte_aligned() 63 psa_status_t status; in mbedtls_psa_rsa_load_representation() local 74 status = mbedtls_to_psa_error(mbedtls_rsa_parse_key(*p_rsa, data, data_length)); in mbedtls_psa_rsa_load_representation() 76 status = mbedtls_to_psa_error(mbedtls_rsa_parse_pubkey(*p_rsa, data, data_length)); in mbedtls_psa_rsa_load_representation() 78 if (status != PSA_SUCCESS) { in mbedtls_psa_rsa_load_representation() 87 status = PSA_ERROR_NOT_SUPPORTED; in mbedtls_psa_rsa_load_representation() [all …]
|
D | psa_crypto_storage.c | 79 psa_status_t status; in psa_crypto_storage_load() local 84 status = psa_its_get_info(data_identifier, &data_identifier_info); in psa_crypto_storage_load() 85 if (status != PSA_SUCCESS) { in psa_crypto_storage_load() 86 return status; in psa_crypto_storage_load() 89 status = psa_its_get(data_identifier, 0, (uint32_t) data_size, data, &data_length); in psa_crypto_storage_load() 94 return status; in psa_crypto_storage_load() 132 psa_status_t status; in psa_crypto_storage_store() local 140 status = psa_its_set(data_identifier, (uint32_t) data_length, data, 0); in psa_crypto_storage_store() 141 if (status != PSA_SUCCESS) { in psa_crypto_storage_store() 145 status = psa_its_get_info(data_identifier, &data_identifier_info); in psa_crypto_storage_store() [all …]
|
D | psa_crypto_aead.c | 33 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_aead_setup() local 39 status = mbedtls_cipher_values_from_psa(alg, attributes->type, in psa_aead_setup() 41 if (status != PSA_SUCCESS) { in psa_aead_setup() 42 return status; in psa_aead_setup() 57 status = mbedtls_to_psa_error( in psa_aead_setup() 60 if (status != PSA_SUCCESS) { in psa_aead_setup() 61 return status; in psa_aead_setup() 77 status = mbedtls_to_psa_error( in psa_aead_setup() 80 if (status != PSA_SUCCESS) { in psa_aead_setup() 81 return status; in psa_aead_setup() [all …]
|
D | lmots.c | 38 static int local_err_translation(psa_status_t status) in local_err_translation() argument 40 return psa_status_to_mbedtls(status, psa_to_lms_errors, in local_err_translation() 44 #define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) argument 126 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in create_digit_array_with_checksum() local 130 status = psa_hash_setup(&op, PSA_ALG_SHA_256); in create_digit_array_with_checksum() 131 if (status != PSA_SUCCESS) { in create_digit_array_with_checksum() 135 status = psa_hash_update(&op, params->I_key_identifier, in create_digit_array_with_checksum() 137 if (status != PSA_SUCCESS) { in create_digit_array_with_checksum() 141 status = psa_hash_update(&op, params->q_leaf_identifier, in create_digit_array_with_checksum() 143 if (status != PSA_SUCCESS) { in create_digit_array_with_checksum() [all …]
|
D | psa_crypto_mac.c | 41 psa_status_t status; in psa_hmac_setup_internal() local 62 status = psa_hash_compute(hash_alg, key, key_length, in psa_hmac_setup_internal() 64 if (status != PSA_SUCCESS) { in psa_hmac_setup_internal() 90 status = psa_hash_setup(&hmac->hash_ctx, hash_alg); in psa_hmac_setup_internal() 91 if (status != PSA_SUCCESS) { in psa_hmac_setup_internal() 95 status = psa_hash_update(&hmac->hash_ctx, ipad, block_size); in psa_hmac_setup_internal() 100 return status; in psa_hmac_setup_internal() 120 psa_status_t status; in psa_hmac_finish_internal() local 122 status = psa_hash_finish(&hmac->hash_ctx, tmp, sizeof(tmp), &hash_size); in psa_hmac_finish_internal() 123 if (status != PSA_SUCCESS) { in psa_hmac_finish_internal() [all …]
|
D | ssl_cookie.c | 30 static int local_err_translation(psa_status_t status) in local_err_translation() argument 32 return psa_status_to_mbedtls(status, psa_to_ssl_errors, in local_err_translation() 36 #define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) argument 110 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_ssl_cookie_setup() local 130 if ((status = psa_generate_key(&attributes, in mbedtls_ssl_cookie_setup() 132 return PSA_TO_MBEDTLS_ERR(status); in mbedtls_ssl_cookie_setup() 195 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_ssl_cookie_write() local 218 status = psa_mac_sign_setup(&operation, ctx->psa_hmac_key, in mbedtls_ssl_cookie_write() 220 if (status != PSA_SUCCESS) { in mbedtls_ssl_cookie_write() 221 ret = PSA_TO_MBEDTLS_ERR(status); in mbedtls_ssl_cookie_write() [all …]
|
D | pk_wrap.c | 73 psa_status_t status; in rsa_verify_wrap() local 105 status = psa_import_key(&attributes, in rsa_verify_wrap() 108 if (status != PSA_SUCCESS) { in rsa_verify_wrap() 109 ret = PSA_PK_TO_MBEDTLS_ERR(status); in rsa_verify_wrap() 113 status = psa_verify_hash(key_id, psa_alg_md, hash, hash_len, in rsa_verify_wrap() 115 if (status != PSA_SUCCESS) { in rsa_verify_wrap() 116 ret = PSA_PK_RSA_TO_MBEDTLS_ERR(status); in rsa_verify_wrap() 122 status = psa_destroy_key(key_id); in rsa_verify_wrap() 123 if (ret == 0 && status != PSA_SUCCESS) { in rsa_verify_wrap() 124 ret = PSA_PK_TO_MBEDTLS_ERR(status); in rsa_verify_wrap() [all …]
|
D | psa_crypto_cipher.c | 265 psa_status_t status; in mbedtls_cipher_info_from_psa() local 268 status = mbedtls_cipher_values_from_psa(alg, key_type, &key_bits, &mode, &cipher_id_tmp); in mbedtls_cipher_info_from_psa() 269 if (status != PSA_SUCCESS) { in mbedtls_cipher_info_from_psa() 426 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_cipher_update_ecb() local 432 status = PSA_SUCCESS; in psa_cipher_update_ecb() 451 status = mbedtls_to_psa_error( in psa_cipher_update_ecb() 457 if (status != PSA_SUCCESS) { in psa_cipher_update_ecb() 469 status = mbedtls_to_psa_error( in psa_cipher_update_ecb() 474 if (status != PSA_SUCCESS) { in psa_cipher_update_ecb() 492 status = PSA_SUCCESS; in psa_cipher_update_ecb() [all …]
|
D | psa_crypto_pake.c | 158 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_psa_pake_setup() local 164 status = psa_crypto_driver_pake_get_password_len(inputs, &password_len); in mbedtls_psa_pake_setup() 165 if (status != PSA_SUCCESS) { in mbedtls_psa_pake_setup() 166 return status; in mbedtls_psa_pake_setup() 169 status = psa_crypto_driver_pake_get_user_len(inputs, &user_len); in mbedtls_psa_pake_setup() 170 if (status != PSA_SUCCESS) { in mbedtls_psa_pake_setup() 171 return status; in mbedtls_psa_pake_setup() 174 status = psa_crypto_driver_pake_get_peer_len(inputs, &peer_len); in mbedtls_psa_pake_setup() 175 if (status != PSA_SUCCESS) { in mbedtls_psa_pake_setup() 176 return status; in mbedtls_psa_pake_setup() [all …]
|
D | psa_crypto_se.c | 128 psa_status_t status; in psa_load_se_persistent_data() local 132 status = psa_get_se_driver_its_file_uid(driver, &uid); in psa_load_se_persistent_data() 133 if (status != PSA_SUCCESS) { in psa_load_se_persistent_data() 134 return status; in psa_load_se_persistent_data() 153 psa_status_t status; in psa_save_se_persistent_data() local 156 status = psa_get_se_driver_its_file_uid(driver, &uid); in psa_save_se_persistent_data() 157 if (status != PSA_SUCCESS) { in psa_save_se_persistent_data() 158 return status; in psa_save_se_persistent_data() 186 psa_status_t status; in psa_find_se_slot_for_key() local 210 status = p_validate_slot_number(&driver->u.context, in psa_find_se_slot_for_key() [all …]
|
D | ssl_tls13_keys.c | 29 static int local_err_translation(psa_status_t status) in local_err_translation() argument 31 return psa_status_to_mbedtls(status, psa_to_ssl_errors, in local_err_translation() 35 #define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) argument 149 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_ssl_tls13_hkdf_expand_label() local 181 status = psa_key_derivation_setup(&operation, PSA_ALG_HKDF_EXPAND(hash_alg)); in mbedtls_ssl_tls13_hkdf_expand_label() 183 if (status != PSA_SUCCESS) { in mbedtls_ssl_tls13_hkdf_expand_label() 187 status = psa_key_derivation_input_bytes(&operation, in mbedtls_ssl_tls13_hkdf_expand_label() 192 if (status != PSA_SUCCESS) { in mbedtls_ssl_tls13_hkdf_expand_label() 196 status = psa_key_derivation_input_bytes(&operation, in mbedtls_ssl_tls13_hkdf_expand_label() 201 if (status != PSA_SUCCESS) { in mbedtls_ssl_tls13_hkdf_expand_label() [all …]
|
D | lms.c | 39 static int local_err_translation(psa_status_t status) in local_err_translation() argument 41 return psa_status_to_mbedtls(status, psa_to_lms_errors, in local_err_translation() 45 #define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) argument 100 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in create_merkle_leaf_value() local 105 status = psa_hash_setup(&op, PSA_ALG_SHA_256); in create_merkle_leaf_value() 106 if (status != PSA_SUCCESS) { in create_merkle_leaf_value() 110 status = psa_hash_update(&op, params->I_key_identifier, in create_merkle_leaf_value() 112 if (status != PSA_SUCCESS) { in create_merkle_leaf_value() 117 status = psa_hash_update(&op, r_node_idx_bytes, 4); in create_merkle_leaf_value() 118 if (status != PSA_SUCCESS) { in create_merkle_leaf_value() [all …]
|
D | ctr_drbg.c | 40 psa_status_t status; in ctr_drbg_setup_psa_context() local 45 status = psa_import_key(&key_attr, key, key_len, &psa_ctx->key_id); in ctr_drbg_setup_psa_context() 46 if (status != PSA_SUCCESS) { in ctr_drbg_setup_psa_context() 50 status = psa_cipher_encrypt_setup(&psa_ctx->operation, psa_ctx->key_id, PSA_ALG_ECB_NO_PADDING); in ctr_drbg_setup_psa_context() 51 if (status != PSA_SUCCESS) { in ctr_drbg_setup_psa_context() 57 return status; in ctr_drbg_setup_psa_context() 172 psa_status_t status; in block_cipher_df() local 213 status = ctr_drbg_setup_psa_context(&psa_ctx, key, sizeof(key)); in block_cipher_df() 214 if (status != PSA_SUCCESS) { in block_cipher_df() 215 ret = psa_generic_status_to_mbedtls(status); in block_cipher_df() [all …]
|
/mbedtls-latest/tests/src/ |
D | psa_test_wrappers.c | 23 psa_status_t status = (mbedtls_psa_inject_entropy)(arg0_seed, arg1_seed_size); in mbedtls_test_wrap_mbedtls_psa_inject_entropy() local 24 return status; in mbedtls_test_wrap_mbedtls_psa_inject_entropy() 35 …psa_status_t status = (mbedtls_psa_platform_get_builtin_key)(arg0_key_id, arg1_lifetime, arg2_slot… in mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key() local 36 return status; in mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key() 45 psa_status_t status = (mbedtls_psa_register_se_key)(arg0_attributes); in mbedtls_test_wrap_mbedtls_psa_register_se_key() local 46 return status; in mbedtls_test_wrap_mbedtls_psa_register_se_key() 54 psa_status_t status = (psa_aead_abort)(arg0_operation); in mbedtls_test_wrap_psa_aead_abort() local 55 return status; in mbedtls_test_wrap_psa_aead_abort() 78 …psa_status_t status = (psa_aead_decrypt)(arg0_key, arg1_alg, arg2_nonce, arg3_nonce_length, arg4_a… in mbedtls_test_wrap_psa_aead_decrypt() local 85 return status; in mbedtls_test_wrap_psa_aead_decrypt() [all …]
|
D | psa_exercise_key.c | 50 psa_status_t status = psa_get_key_attributes(key, &attributes); in check_key_attributes_sanity() local 51 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in check_key_attributes_sanity() 56 PSA_ASSERT(status); in check_key_attributes_sanity() 79 status = psa_get_key_slot_number(&attributes, &slot_number); in check_key_attributes_sanity() 84 TEST_EQUAL(status, 0); in check_key_attributes_sanity() 87 TEST_EQUAL(status, PSA_ERROR_INVALID_ARGUMENT); in check_key_attributes_sanity() 129 psa_status_t status = PSA_SUCCESS; in exercise_mac_key() local 136 status = psa_mac_sign_setup(&operation, key, alg); in exercise_mac_key() 137 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_mac_key() 142 PSA_ASSERT(status); in exercise_mac_key() [all …]
|
/mbedtls-latest/programs/psa/ |
D | crypto_examples.c | 57 psa_status_t status; in cipher_operation() local 66 status = psa_cipher_update(operation, input + bytes_written, in cipher_operation() 69 ASSERT_STATUS(status, PSA_SUCCESS); in cipher_operation() 75 status = psa_cipher_finish(operation, output + *output_len, in cipher_operation() 77 ASSERT_STATUS(status, PSA_SUCCESS); in cipher_operation() 81 return status; in cipher_operation() 95 psa_status_t status; in cipher_encrypt() local 100 status = psa_cipher_encrypt_setup(&operation, key, alg); in cipher_encrypt() 101 ASSERT_STATUS(status, PSA_SUCCESS); in cipher_encrypt() 103 status = psa_cipher_generate_iv(&operation, iv, iv_size, &iv_len); in cipher_encrypt() [all …]
|
D | psa_hash.c | 61 psa_status_t status; in main() local 69 status = psa_crypto_init(); in main() 70 if (status != PSA_SUCCESS) { in main() 76 status = psa_hash_setup(&hash_operation, HASH_ALG); in main() 77 if (status == PSA_ERROR_NOT_SUPPORTED) { in main() 80 } else if (status != PSA_SUCCESS) { in main() 85 status = psa_hash_update(&hash_operation, sample_message, sample_message_length); in main() 86 if (status != PSA_SUCCESS) { in main() 91 status = psa_hash_clone(&hash_operation, &cloned_hash_operation); in main() 92 if (status != PSA_SUCCESS) { in main() [all …]
|
D | key_ladder_demo.c | 77 status = DEMO_ERROR; \ 87 status = (expr); \ 88 if (status != PSA_SUCCESS) \ 91 (int) status, \ 158 psa_status_t status = PSA_SUCCESS; in save_key() local 177 return status; in save_key() 187 psa_status_t status = PSA_SUCCESS; in generate() local 203 return status; in generate() 216 psa_status_t status = PSA_SUCCESS; in import_key_from_file() local 231 status = DEMO_ERROR; in import_key_from_file() [all …]
|
/mbedtls-latest/scripts/data_files/driver_templates/ |
D | psa_crypto_driver_wrappers.h.jinja | 75 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; 78 status = psa_init_all_se_drivers( ); 79 if( status != PSA_SUCCESS ) 80 return( status ); 84 status = mbedtls_test_transparent_init( ); 85 if( status != PSA_SUCCESS ) 86 return( status ); 88 status = mbedtls_test_opaque_init( ); 89 if( status != PSA_SUCCESS ) 90 return( status ); [all …]
|
/mbedtls-latest/tests/src/drivers/ |
D | test_driver_key_management.c | 57 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_test_transparent_init() local 60 status = libtestdriver1_psa_crypto_init(); in mbedtls_test_transparent_init() 61 if (status != PSA_SUCCESS) { in mbedtls_test_transparent_init() 62 return status; in mbedtls_test_transparent_init() 66 (void) status; in mbedtls_test_transparent_init() 356 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_test_opaque_import_key() local 377 status = psa_validate_unstructured_key_bit_size(type, in mbedtls_test_opaque_import_key() 379 if (status != PSA_SUCCESS) { in mbedtls_test_opaque_import_key() 394 status = libtestdriver1_mbedtls_psa_ecp_import_key( in mbedtls_test_opaque_import_key() 401 status = mbedtls_psa_ecp_import_key( in mbedtls_test_opaque_import_key() [all …]
|
/mbedtls-latest/tests/suites/ |
D | test_suite_psa_crypto_entropy.function | 43 psa_status_t status = psa_its_get_info(PSA_CRYPTO_ITS_RANDOM_SEED_UID, 47 TEST_EQUAL(status, PSA_ERROR_DOES_NOT_EXIST); 49 TEST_EQUAL(status, PSA_SUCCESS); 155 psa_status_t status; 171 status = remove_seed_file(); 172 TEST_ASSERT((status == PSA_SUCCESS) || 173 (status == PSA_ERROR_DOES_NOT_EXIST)); 178 status = mbedtls_psa_inject_entropy(seed, seed_length_a); 179 TEST_EQUAL(status, expected_status_a); 185 status = mbedtls_psa_inject_entropy(seed, seed_length_b); [all …]
|