Lines Matching refs:attributes

122 psa_status_t psa_driver_wrapper_sign_message(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
128 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
136 status = mbedtls_test_transparent_signature_sign_message(attributes, key_buffer, key_buffer_size, alg,
151 mbedtls_test_opaque_signature_sign_message(attributes, key_buffer, key_buffer_size, alg, input,
164 return (psa_sign_message_builtin(attributes, key_buffer, key_buffer_size, alg, input, input_length, signature,
168 psa_status_t psa_driver_wrapper_verify_message(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
173 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
182 attributes, key_buffer, key_buffer_size, alg, input, input_length, signature, signature_length);
194 return (mbedtls_test_opaque_signature_verify_message(attributes, key_buffer, key_buffer_size, alg, input,
207 return (psa_verify_message_builtin(attributes, key_buffer, key_buffer_size, alg, input, input_length, signature,
211 psa_status_t psa_driver_wrapper_sign_hash(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
221 if (psa_get_se_driver(psa_get_key_lifetime(attributes), &drv, &drv_context)) {
232 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
241 mbedtls_test_transparent_signature_sign_hash(attributes, key_buffer, key_buffer_size, alg, hash,
248 if (PSA_KEY_TYPE_IS_ECC(psa_get_key_type(attributes)) && PSA_ALG_IS_ECDSA(alg) &&
250 PSA_KEY_TYPE_ECC_GET_FAMILY(psa_get_key_type(attributes)) == PSA_ECC_FAMILY_SECP_R1 &&
251 psa_get_key_bits(attributes) == 256) {
252 status = p256_transparent_sign_hash(attributes, key_buffer, key_buffer_size, alg, hash, hash_length,
260 return (psa_sign_hash_builtin(attributes, key_buffer, key_buffer_size, alg, hash, hash_length, signature,
267 return (mbedtls_test_opaque_signature_sign_hash(attributes, key_buffer, key_buffer_size, alg, hash,
278 psa_status_t psa_driver_wrapper_verify_hash(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
287 if (psa_get_se_driver(psa_get_key_lifetime(attributes), &drv, &drv_context)) {
298 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
306 status = mbedtls_test_transparent_signature_verify_hash(attributes, key_buffer, key_buffer_size, alg, hash,
313 if (PSA_KEY_TYPE_IS_ECC(psa_get_key_type(attributes)) && PSA_ALG_IS_ECDSA(alg) &&
315 PSA_KEY_TYPE_ECC_GET_FAMILY(psa_get_key_type(attributes)) == PSA_ECC_FAMILY_SECP_R1 &&
316 psa_get_key_bits(attributes) == 256) {
317 status = p256_transparent_verify_hash(attributes, key_buffer, key_buffer_size, alg, hash, hash_length,
325 return (psa_verify_hash_builtin(attributes, key_buffer, key_buffer_size, alg, hash, hash_length, signature,
332 return (mbedtls_test_opaque_signature_verify_hash(attributes, key_buffer, key_buffer_size, alg, hash,
388 const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
393 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
412 status = mbedtls_psa_sign_hash_start(&operation->ctx.mbedtls_ctx, attributes, key_buffer, key_buffer_size,
468 const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
473 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
492 status = mbedtls_psa_verify_hash_start(&operation->ctx.mbedtls_ctx, attributes, key_buffer, key_buffer_size,
544 * \param[in] attributes The key attributes
553 psa_status_t psa_driver_wrapper_get_key_buffer_size_from_key_data(const psa_key_attributes_t *attributes,
557 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
558 psa_key_type_t key_type = psa_get_key_type(attributes);
579 * \param[in] attributes The key attributes.
591 psa_status_t psa_driver_wrapper_get_key_buffer_size(const psa_key_attributes_t *attributes, size_t *key_buffer_size)
593 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
594 psa_key_type_t key_type = psa_get_key_type(attributes);
595 size_t key_bits = psa_get_key_bits(attributes);
603 if (psa_key_id_is_builtin(MBEDTLS_SVC_KEY_ID_GET_KEY_ID(psa_get_key_id(attributes)))) {
619 psa_status_t psa_driver_wrapper_generate_key(const psa_key_attributes_t *attributes,
624 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
642 if (psa_get_se_driver(psa_get_key_lifetime(attributes), &drv, &drv_context)) {
648 return (drv->key_management->p_generate(drv_context, *((psa_key_slot_number_t *)key_buffer), attributes, NULL,
659 if (PSA_KEY_TYPE_IS_ASYMMETRIC(psa_get_key_type(attributes)) && is_default_production) {
663 mbedtls_test_transparent_generate_key(attributes, key_buffer, key_buffer_size, key_buffer_length);
669 if (PSA_KEY_TYPE_IS_ECC(psa_get_key_type(attributes)) &&
670 psa_get_key_type(attributes) == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1) &&
671 psa_get_key_bits(attributes) == 256) {
672 status = p256_transparent_generate_key(attributes, key_buffer, key_buffer_size, key_buffer_length);
682 status = psa_generate_key_internal(attributes, params, params_data_length, key_buffer, key_buffer_size,
690 status = mbedtls_test_opaque_generate_key(attributes, key_buffer, key_buffer_size, key_buffer_length);
704 psa_status_t psa_driver_wrapper_import_key(const psa_key_attributes_t *attributes, const uint8_t *data,
710 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
717 if (psa_get_se_driver(psa_get_key_lifetime(attributes), &drv, &drv_context)) {
724 status = drv->key_management->p_import(drv_context, *((psa_key_slot_number_t *)key_buffer), attributes, data,
744 status = mbedtls_test_transparent_import_key(attributes, data, data_length, key_buffer, key_buffer_size,
752 status = p256_transparent_import_key(attributes, data, data_length, key_buffer, key_buffer_size,
762 return (psa_import_key_into_slot(attributes, data, data_length, key_buffer, key_buffer_size,
769 return (mbedtls_test_opaque_import_key(attributes, data, data_length, key_buffer, key_buffer_size,
780 psa_status_t psa_driver_wrapper_export_key(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
786 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
793 if (psa_get_se_driver(psa_get_key_lifetime(attributes), &drv, &drv_context)) {
805 return (psa_export_key_internal(attributes, key_buffer, key_buffer_size, data, data_size, data_length));
813 mbedtls_test_opaque_export_key(attributes, key_buffer, key_buffer_size, data, data_size, data_length));
823 psa_status_t psa_driver_wrapper_export_public_key(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
830 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
837 if (psa_get_se_driver(attributes->core.lifetime, &drv, &drv_context)) {
854 status = mbedtls_test_transparent_export_public_key(attributes, key_buffer, key_buffer_size, data,
864 psa_export_public_key_internal(attributes, key_buffer, key_buffer_size, data, data_size, data_length));
871 return (mbedtls_test_opaque_export_public_key(attributes, key_buffer, key_buffer_size, data, data_size,
882 psa_status_t psa_driver_wrapper_get_builtin_key(psa_drv_slot_number_t slot_number, psa_key_attributes_t *attributes,
886 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
892 return (mbedtls_test_opaque_get_builtin_key(slot_number, attributes, key_buffer, key_buffer_size,
906 psa_status_t psa_driver_wrapper_copy_key(psa_key_attributes_t *attributes, const uint8_t *source_key,
912 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
918 if (psa_get_se_driver(psa_get_key_lifetime(attributes), &drv, &drv_context)) {
929 return (mbedtls_test_opaque_copy_key(attributes, source_key, source_key_length, target_key_buffer,
948 psa_status_t psa_driver_wrapper_cipher_encrypt(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
954 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
963 mbedtls_test_transparent_cipher_encrypt(attributes, key_buffer, key_buffer_size, alg, iv, iv_length,
972 return (mbedtls_psa_cipher_encrypt(attributes, key_buffer, key_buffer_size, alg, iv, iv_length, input,
982 return (mbedtls_test_opaque_cipher_encrypt(attributes, key_buffer, key_buffer_size, alg, iv, iv_length,
1004 psa_status_t psa_driver_wrapper_cipher_decrypt(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
1010 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
1018 status = mbedtls_test_transparent_cipher_decrypt(attributes, key_buffer, key_buffer_size, alg, input,
1027 return (mbedtls_psa_cipher_decrypt(attributes, key_buffer, key_buffer_size, alg, input, input_length,
1037 return (mbedtls_test_opaque_cipher_decrypt(attributes, key_buffer, key_buffer_size, alg, input,
1058 const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
1062 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
1071 attributes, key_buffer, key_buffer_size, alg);
1082 status = mbedtls_psa_cipher_encrypt_setup(&operation->ctx.mbedtls_ctx, attributes, key_buffer,
1096 status = mbedtls_test_opaque_cipher_encrypt_setup(&operation->ctx.opaque_test_driver_ctx, attributes,
1117 const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
1121 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
1130 attributes, key_buffer, key_buffer_size, alg);
1141 status = mbedtls_psa_cipher_decrypt_setup(&operation->ctx.mbedtls_ctx, attributes, key_buffer,
1155 status = mbedtls_test_opaque_cipher_decrypt_setup(&operation->ctx.opaque_test_driver_ctx, attributes,
1431 psa_status_t psa_driver_wrapper_aead_encrypt(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
1439 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
1449 attributes, key_buffer, key_buffer_size, alg, nonce, nonce_length, additional_data,
1458 return (mbedtls_psa_aead_encrypt(attributes, key_buffer, key_buffer_size, alg, nonce, nonce_length,
1471 psa_status_t psa_driver_wrapper_aead_decrypt(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
1479 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
1489 attributes, key_buffer, key_buffer_size, alg, nonce, nonce_length, additional_data,
1498 return (mbedtls_psa_aead_decrypt(attributes, key_buffer, key_buffer_size, alg, nonce, nonce_length,
1512 const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
1516 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
1527 attributes, key_buffer, key_buffer_size, alg);
1537 status = mbedtls_psa_aead_encrypt_setup(&operation->ctx.mbedtls_ctx, attributes, key_buffer,
1552 const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
1556 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
1567 attributes, key_buffer, key_buffer_size, alg);
1577 status = mbedtls_psa_aead_decrypt_setup(&operation->ctx.mbedtls_ctx, attributes, key_buffer,
1814 psa_status_t psa_driver_wrapper_mac_compute(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
1819 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
1827 status = mbedtls_test_transparent_mac_compute(attributes, key_buffer, key_buffer_size, alg, input,
1836 status = mbedtls_psa_mac_compute(attributes, key_buffer, key_buffer_size, alg, input, input_length, mac,
1847 status = mbedtls_test_opaque_mac_compute(attributes, key_buffer, key_buffer_size, alg, input, input_length,
1867 psa_status_t psa_driver_wrapper_mac_sign_setup(psa_mac_operation_t *operation, const psa_key_attributes_t *attributes,
1871 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
1879 status = mbedtls_test_transparent_mac_sign_setup(&operation->ctx.transparent_test_driver_ctx, attributes,
1892 mbedtls_psa_mac_sign_setup(&operation->ctx.mbedtls_ctx, attributes, key_buffer, key_buffer_size, alg);
1905 status = mbedtls_test_opaque_mac_sign_setup(&operation->ctx.opaque_test_driver_ctx, attributes, key_buffer,
1925 psa_status_t psa_driver_wrapper_mac_verify_setup(psa_mac_operation_t *operation, const psa_key_attributes_t *attributes,
1929 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
1937 status = mbedtls_test_transparent_mac_verify_setup(&operation->ctx.transparent_test_driver_ctx, attributes,
1950 mbedtls_psa_mac_verify_setup(&operation->ctx.mbedtls_ctx, attributes, key_buffer, key_buffer_size, alg);
1963 status = mbedtls_test_opaque_mac_verify_setup(&operation->ctx.opaque_test_driver_ctx, attributes,
2085 psa_status_t psa_driver_wrapper_asymmetric_encrypt(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
2091 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
2099 status = mbedtls_test_transparent_asymmetric_encrypt(attributes, key_buffer, key_buffer_size, alg, input,
2107 return (mbedtls_psa_asymmetric_encrypt(attributes, key_buffer, key_buffer_size, alg, input, input_length,
2113 return (mbedtls_test_opaque_asymmetric_encrypt(attributes, key_buffer, key_buffer_size, alg, input,
2136 psa_status_t psa_driver_wrapper_asymmetric_decrypt(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
2142 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
2150 status = mbedtls_test_transparent_asymmetric_decrypt(attributes, key_buffer, key_buffer_size, alg, input,
2158 return (mbedtls_psa_asymmetric_decrypt(attributes, key_buffer, key_buffer_size, alg, input, input_length,
2164 return (mbedtls_test_opaque_asymmetric_decrypt(attributes, key_buffer, key_buffer_size, alg, input,
2187 psa_status_t psa_driver_wrapper_key_agreement(const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
2193 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
2201 status = mbedtls_test_transparent_key_agreement(attributes, key_buffer, key_buffer_size, alg, peer_key,
2208 if (PSA_KEY_TYPE_IS_ECC(psa_get_key_type(attributes)) && PSA_ALG_IS_ECDH(alg) &&
2209 PSA_KEY_TYPE_ECC_GET_FAMILY(psa_get_key_type(attributes)) == PSA_ECC_FAMILY_SECP_R1 &&
2210 psa_get_key_bits(attributes) == 256) {
2211 status = p256_transparent_key_agreement(attributes, key_buffer, key_buffer_size, alg, peer_key,
2222 psa_key_agreement_raw_builtin(attributes, key_buffer, key_buffer_size, alg, peer_key, peer_key_length,
2228 return (mbedtls_test_opaque_key_agreement(attributes, key_buffer, key_buffer_size, alg, peer_key,
2235 (void)attributes;
2252 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(&inputs->attributes));