Lines Matching refs:key

41 static int check_key_attributes_sanity(mbedtls_svc_key_id_t key,  in check_key_attributes_sanity()  argument
50 psa_status_t status = psa_get_key_attributes(key, &attributes); in check_key_attributes_sanity()
120 static int exercise_mac_key(mbedtls_svc_key_id_t key, in exercise_mac_key() argument
136 status = psa_mac_sign_setup(&operation, key, alg); in exercise_mac_key()
155 status = psa_mac_verify_setup(&operation, key, alg); in exercise_mac_key()
175 static int exercise_cipher_key(mbedtls_svc_key_id_t key, in exercise_cipher_key() argument
192 PSA_ASSERT(psa_get_key_attributes(key, &attributes)); in exercise_cipher_key()
197 status = psa_cipher_encrypt_setup(&operation, key, alg); in exercise_cipher_key()
225 status = psa_cipher_decrypt_setup(&operation, key, alg); in exercise_cipher_key()
263 static int exercise_aead_key(mbedtls_svc_key_id_t key, in exercise_aead_key() argument
283 PSA_ASSERT(psa_get_key_attributes(key, &attributes)); in exercise_aead_key()
288 status = psa_aead_encrypt(key, alg, in exercise_aead_key()
306 status = psa_aead_decrypt(key, alg, in exercise_aead_key()
338 static int exercise_signature_key(mbedtls_svc_key_id_t key, in exercise_signature_key() argument
372 status = psa_sign_hash(key, alg, in exercise_signature_key()
388 status = psa_verify_hash(key, alg, in exercise_signature_key()
406 status = psa_sign_message(key, alg, in exercise_signature_key()
422 status = psa_verify_message(key, alg, in exercise_signature_key()
439 static int exercise_asymmetric_encryption_key(mbedtls_svc_key_id_t key, in exercise_asymmetric_encryption_key() argument
452 status = psa_asymmetric_encrypt(key, alg, in exercise_asymmetric_encryption_key()
465 status = psa_asymmetric_decrypt(key, alg, in exercise_asymmetric_encryption_key()
488 mbedtls_svc_key_id_t key, in mbedtls_test_psa_setup_key_derivation_wrap() argument
502 key); in mbedtls_test_psa_setup_key_derivation_wrap()
518 key); in mbedtls_test_psa_setup_key_derivation_wrap()
527 key); in mbedtls_test_psa_setup_key_derivation_wrap()
544 key); in mbedtls_test_psa_setup_key_derivation_wrap()
563 key); in mbedtls_test_psa_setup_key_derivation_wrap()
588 static int exercise_key_derivation_key(mbedtls_svc_key_id_t key, in exercise_key_derivation_key() argument
602 if (!mbedtls_test_psa_setup_key_derivation_wrap(&operation, key, alg, in exercise_key_derivation_key()
631 mbedtls_svc_key_id_t key, int key_destroyable) in mbedtls_test_psa_key_agreement_with_self() argument
640 psa_status_t status = psa_get_key_attributes(key, &attributes); in mbedtls_test_psa_key_agreement_with_self()
653 status = psa_export_public_key(key, public_key, public_key_length, in mbedtls_test_psa_key_agreement_with_self()
663 operation, PSA_KEY_DERIVATION_INPUT_SECRET, key, in mbedtls_test_psa_key_agreement_with_self()
685 mbedtls_svc_key_id_t key, in mbedtls_test_psa_raw_key_agreement_with_self() argument
697 psa_status_t status = psa_get_key_attributes(key, &attributes); in mbedtls_test_psa_raw_key_agreement_with_self()
710 status = psa_export_public_key(key, in mbedtls_test_psa_raw_key_agreement_with_self()
720 status = psa_raw_key_agreement(alg, key, in mbedtls_test_psa_raw_key_agreement_with_self()
747 static int exercise_raw_key_agreement_key(mbedtls_svc_key_id_t key, in exercise_raw_key_agreement_key() argument
757 PSA_ASSERT(mbedtls_test_psa_raw_key_agreement_with_self(alg, key, in exercise_raw_key_agreement_key()
766 static int exercise_key_agreement_key(mbedtls_svc_key_id_t key, in exercise_key_agreement_key() argument
800 psa_status_t status = psa_get_key_attributes(key, &attributes); in exercise_key_agreement_key()
814 TEST_EQUAL(mbedtls_test_psa_key_agreement_with_self(&operation, key, in exercise_key_agreement_key()
1005 static int exercise_export_key(mbedtls_svc_key_id_t key, in exercise_export_key() argument
1015 psa_status_t status = psa_get_key_attributes(key, &attributes); in exercise_export_key()
1028 status = psa_export_key(key, exported, exported_size, &exported_length); in exercise_export_key()
1055 static int exercise_export_public_key(mbedtls_svc_key_id_t key, in exercise_export_public_key() argument
1065 psa_status_t status = psa_get_key_attributes(key, &attributes); in exercise_export_public_key()
1078 status = psa_export_public_key(key, exported, in exercise_export_public_key()
1096 status = psa_export_public_key(key, exported, in exercise_export_public_key()
1119 int mbedtls_test_psa_exercise_key(mbedtls_svc_key_id_t key, in mbedtls_test_psa_exercise_key() argument
1126 if (!check_key_attributes_sanity(key, key_destroyable)) { in mbedtls_test_psa_exercise_key()
1133 ok = exercise_mac_key(key, usage, alg, key_destroyable); in mbedtls_test_psa_exercise_key()
1135 ok = exercise_cipher_key(key, usage, alg, key_destroyable); in mbedtls_test_psa_exercise_key()
1137 ok = exercise_aead_key(key, usage, alg, key_destroyable); in mbedtls_test_psa_exercise_key()
1139 ok = exercise_signature_key(key, usage, alg, key_destroyable); in mbedtls_test_psa_exercise_key()
1141 ok = exercise_asymmetric_encryption_key(key, usage, alg, in mbedtls_test_psa_exercise_key()
1144 ok = exercise_key_derivation_key(key, usage, alg, key_destroyable); in mbedtls_test_psa_exercise_key()
1146 ok = exercise_raw_key_agreement_key(key, usage, alg, key_destroyable); in mbedtls_test_psa_exercise_key()
1148 ok = exercise_key_agreement_key(key, usage, alg, key_destroyable); in mbedtls_test_psa_exercise_key()
1153 ok = ok && exercise_export_key(key, in mbedtls_test_psa_exercise_key()
1156 ok = ok && exercise_export_public_key(key, in mbedtls_test_psa_exercise_key()