Home
last modified time | relevance | path

Searched refs:attributes (Results 1 – 25 of 95) sorted by relevance

1234

/mbedtls-latest/tests/suites/
Dtest_suite_psa_crypto_attributes.function15 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
24 MBEDTLS_SVC_KEY_ID_GET_KEY_ID(psa_get_key_id(&attributes)), 0);
26 MBEDTLS_SVC_KEY_ID_GET_OWNER_ID(psa_get_key_id(&attributes)), 0);
27 TEST_EQUAL(psa_get_key_lifetime(&attributes), 0);
28 TEST_EQUAL(psa_get_key_usage_flags(&attributes), 0);
29 TEST_EQUAL(psa_get_key_algorithm(&attributes), 0);
30 TEST_EQUAL(psa_get_key_type(&attributes), 0);
31 TEST_EQUAL(psa_get_key_bits(&attributes), 0);
33 psa_set_key_id(&attributes, id);
34 psa_set_key_lifetime(&attributes, lifetime);
[all …]
Dtest_suite_psa_crypto_persistent_key.function53 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
55 psa_set_key_lifetime(&attributes, key_lifetime);
56 psa_set_key_type(&attributes, key_type);
57 psa_set_key_bits(&attributes, key_bits);
58 psa_set_key_usage_flags(&attributes, key_usage);
59 psa_set_key_algorithm(&attributes, key_alg);
60 psa_set_key_enrollment_algorithm(&attributes, key_alg2);
64 &attributes,
88 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
93 &attributes);
[all …]
Dtest_suite_psa_crypto_slot_management.function144 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
153 mbedtls_set_key_owner_id(&attributes, owner_id);
158 psa_set_key_usage_flags(&attributes, usage_flags);
159 psa_set_key_algorithm(&attributes, alg);
160 psa_set_key_type(&attributes, type);
161 PSA_ASSERT(psa_import_key(&attributes, key_data->x, key_data->len,
164 PSA_ASSERT(psa_get_key_attributes(key, &attributes));
165 TEST_EQUAL(psa_get_key_type(&attributes), type);
166 psa_reset_key_attributes(&attributes);
177 TEST_EQUAL(psa_get_key_attributes(key_with_invalid_owner, &attributes),
[all …]
Dtest_suite_psa_crypto_se_driver_hal_mocks.function22 psa_key_attributes_t attributes;
30 psa_key_attributes_t attributes;
128 const psa_key_attributes_t *attributes,
139 mock_generate_data.attributes = *attributes;
147 const psa_key_attributes_t *attributes,
159 mock_import_data.attributes = *attributes;
245 const psa_key_attributes_t *attributes,
251 (void) attributes;
331 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
348 psa_set_key_id(&attributes, id);
[all …]
Dtest_suite_psa_crypto_op_fail.function79 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
87 psa_set_key_type(&attributes, key_type);
88 psa_set_key_usage_flags(&attributes,
91 psa_set_key_algorithm(&attributes, alg);
92 PSA_ASSERT(psa_import_key(&attributes,
112 psa_reset_key_attributes(&attributes);
125 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
133 psa_set_key_type(&attributes, key_type);
134 psa_set_key_usage_flags(&attributes,
137 psa_set_key_algorithm(&attributes, alg);
[all …]
Dtest_suite_psa_crypto_se_driver_hal.function146 const psa_key_attributes_t *attributes,
152 (void) attributes;
168 const psa_key_attributes_t *attributes,
173 (void) attributes;
191 const psa_key_attributes_t *attributes,
198 (void) attributes;
211 const psa_key_attributes_t *attributes,
218 (void) attributes;
221 if (!PSA_KEY_TYPE_IS_KEY_PAIR(psa_get_key_type(attributes))) {
281 const psa_key_attributes_t *attributes,
[all …]
Dtest_suite_psa_crypto_storage_format.function13 /** Write a key with the given attributes and key material to storage.
19 static int test_written_key(const psa_key_attributes_t *attributes,
31 PSA_ASSERT(psa_import_key(attributes, material->x, material->len,
33 TEST_ASSERT(mbedtls_svc_key_id_equal(psa_get_key_id(attributes),
53 static int can_export(const psa_key_attributes_t *attributes)
55 if (psa_get_key_usage_flags(attributes) & PSA_KEY_USAGE_EXPORT) {
57 } else if (PSA_KEY_TYPE_IS_PUBLIC_KEY(psa_get_key_type(attributes))) {
89 static int can_exercise(const psa_key_attributes_t *attributes)
91 psa_key_type_t key_type = psa_get_key_type(attributes);
92 psa_algorithm_t alg = psa_get_key_algorithm(attributes);
[all …]
Dtest_suite_psa_crypto_driver_wrappers.function520 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
532 psa_set_key_type(&attributes,
534 psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_SIGN_HASH);
535 psa_set_key_algorithm(&attributes, alg);
536 psa_import_key(&attributes,
550 PSA_ASSERT(psa_get_key_attributes(key, &attributes));
551 key_bits = psa_get_key_bits(&attributes);
570 psa_reset_key_attributes(&attributes);
596 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
603 psa_set_key_type(&attributes, key_type_public);
[all …]
Dtest_suite_psa_crypto.function164 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
166 psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_SIGN_HASH);
167 psa_set_key_algorithm(&attributes, alg);
168 psa_set_key_type(&attributes, key_type);
169 PSA_ASSERT(psa_import_key(&attributes, key_bytes, key_length, &key));
196 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
198 psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_ENCRYPT);
199 psa_set_key_algorithm(&attributes, alg);
200 psa_set_key_type(&attributes, key_type);
201 PSA_ASSERT(psa_import_key(&attributes, key_bytes, key_length, &key));
[all …]
Dtest_suite_psa_crypto_generate_key.function18 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
27 psa_set_key_type(&attributes, key_type);
28 psa_set_key_bits(&attributes, bits);
29 TEST_EQUAL(psa_generate_key(&attributes, &key_id),
32 // Verify attributes of the created key on success
34 psa_reset_key_attributes(&attributes);
35 PSA_ASSERT(psa_get_key_attributes(key_id, &attributes));
36 TEST_EQUAL(psa_get_key_lifetime(&attributes), PSA_KEY_LIFETIME_VOLATILE);
37 TEST_EQUAL(psa_get_key_usage_flags(&attributes), 0);
38 TEST_EQUAL(psa_get_key_algorithm(&attributes), 0);
[all …]
/mbedtls-latest/tests/src/drivers/
Dtest_driver_key_management.c192 const psa_key_attributes_t *attributes, in mbedtls_test_transparent_generate_key() argument
213 if (PSA_KEY_TYPE_IS_ECC(psa_get_key_type(attributes)) in mbedtls_test_transparent_generate_key()
214 && PSA_KEY_TYPE_IS_KEY_PAIR(psa_get_key_type(attributes))) { in mbedtls_test_transparent_generate_key()
218 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_generate_key()
222 attributes, key, key_size, key_length); in mbedtls_test_transparent_generate_key()
224 } else if (psa_get_key_type(attributes) == PSA_KEY_TYPE_RSA_KEY_PAIR) { in mbedtls_test_transparent_generate_key()
228 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_generate_key()
233 attributes, in mbedtls_test_transparent_generate_key()
237 } else if (PSA_KEY_TYPE_IS_DH(psa_get_key_type(attributes)) in mbedtls_test_transparent_generate_key()
238 && PSA_KEY_TYPE_IS_KEY_PAIR(psa_get_key_type(attributes))) { in mbedtls_test_transparent_generate_key()
[all …]
Dtest_driver_signature.c42 const psa_key_attributes_t *attributes, in sign_hash() argument
52 if (attributes->type == PSA_KEY_TYPE_RSA_KEY_PAIR) { in sign_hash()
59 (const libtestdriver1_psa_key_attributes_t *) attributes, in sign_hash()
66 attributes, in sign_hash()
74 } else if (PSA_KEY_TYPE_IS_ECC(attributes->type)) { in sign_hash()
80 (const libtestdriver1_psa_key_attributes_t *) attributes, in sign_hash()
87 attributes, in sign_hash()
97 (void) attributes; in sign_hash()
110 const psa_key_attributes_t *attributes, in verify_hash() argument
119 if (PSA_KEY_TYPE_IS_RSA(attributes->type)) { in verify_hash()
[all …]
Dtest_driver_cipher.c31 const psa_key_attributes_t *attributes, in mbedtls_test_transparent_cipher_encrypt() argument
69 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_cipher_encrypt()
75 attributes, key_buffer, key_buffer_size, in mbedtls_test_transparent_cipher_encrypt()
84 const psa_key_attributes_t *attributes, in mbedtls_test_transparent_cipher_decrypt() argument
116 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_cipher_decrypt()
122 attributes, key_buffer, key_buffer_size, in mbedtls_test_transparent_cipher_decrypt()
132 const psa_key_attributes_t *attributes, in mbedtls_test_transparent_cipher_encrypt_setup() argument
152 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_cipher_encrypt_setup()
156 operation, attributes, key, key_length, alg); in mbedtls_test_transparent_cipher_encrypt_setup()
164 const psa_key_attributes_t *attributes, in mbedtls_test_transparent_cipher_decrypt_setup() argument
[all …]
Dtest_driver_mac.c23 const psa_key_attributes_t *attributes, in mbedtls_test_transparent_mac_compute() argument
43 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_mac_compute()
50 attributes, key_buffer, key_buffer_size, alg, in mbedtls_test_transparent_mac_compute()
54 (void) attributes; in mbedtls_test_transparent_mac_compute()
72 const psa_key_attributes_t *attributes, in mbedtls_test_transparent_mac_sign_setup() argument
88 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_mac_sign_setup()
93 operation, attributes, key_buffer, key_buffer_size, alg); in mbedtls_test_transparent_mac_sign_setup()
96 (void) attributes; in mbedtls_test_transparent_mac_sign_setup()
109 const psa_key_attributes_t *attributes, in mbedtls_test_transparent_mac_verify_setup() argument
125 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_mac_verify_setup()
[all …]
/mbedtls-latest/library/
Dpsa_crypto_driver_wrappers.h157 const psa_key_attributes_t *attributes, in psa_driver_wrapper_sign_message() argument
169 PSA_KEY_LIFETIME_GET_LOCATION( psa_get_key_lifetime(attributes) ); in psa_driver_wrapper_sign_message()
182 attributes, in psa_driver_wrapper_sign_message()
197 attributes, in psa_driver_wrapper_sign_message()
209 return( psa_sign_message_builtin( attributes, in psa_driver_wrapper_sign_message()
225 attributes, in psa_driver_wrapper_sign_message()
247 const psa_key_attributes_t *attributes, in psa_driver_wrapper_verify_message() argument
258 PSA_KEY_LIFETIME_GET_LOCATION( psa_get_key_lifetime(attributes) ); in psa_driver_wrapper_verify_message()
271 attributes, in psa_driver_wrapper_verify_message()
285 attributes, in psa_driver_wrapper_verify_message()
[all …]
Dpsa_crypto_driver_wrappers_no_static.c116 const psa_key_attributes_t *attributes, in psa_driver_wrapper_get_key_buffer_size() argument
119 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION( psa_get_key_lifetime(attributes) ); in psa_driver_wrapper_get_key_buffer_size()
120 psa_key_type_t key_type = psa_get_key_type(attributes); in psa_driver_wrapper_get_key_buffer_size()
121 size_t key_bits = psa_get_key_bits(attributes); in psa_driver_wrapper_get_key_buffer_size()
132 psa_get_key_id( attributes ) ) ) ) in psa_driver_wrapper_get_key_buffer_size()
146 return tfm_builtin_key_loader_get_key_buffer_size(psa_get_key_id(attributes), in psa_driver_wrapper_get_key_buffer_size()
158 const psa_key_attributes_t *attributes, in psa_driver_wrapper_export_public_key() argument
166 psa_get_key_lifetime( attributes ) ); in psa_driver_wrapper_export_public_key()
173 if( psa_get_se_driver( psa_get_key_lifetime(attributes), &drv, &drv_context ) ) in psa_driver_wrapper_export_public_key()
200 (attributes, in psa_driver_wrapper_export_public_key()
[all …]
Dpk.c160 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; in mbedtls_pk_setup_opaque() local
167 if (PSA_SUCCESS != psa_get_key_attributes(key, &attributes)) { in mbedtls_pk_setup_opaque()
170 type = psa_get_key_type(&attributes); in mbedtls_pk_setup_opaque()
171 psa_reset_key_attributes(&attributes); in mbedtls_pk_setup_opaque()
314 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; in mbedtls_pk_can_do_ext() local
317 status = psa_get_key_attributes(ctx->priv_id, &attributes); in mbedtls_pk_can_do_ext()
322 psa_algorithm_t key_alg = psa_get_key_algorithm(&attributes); in mbedtls_pk_can_do_ext()
329 psa_algorithm_t key_alg2 = psa_get_key_enrollment_algorithm(&attributes); in mbedtls_pk_can_do_ext()
331 key_usage = psa_get_key_usage_flags(&attributes); in mbedtls_pk_can_do_ext()
332 psa_reset_key_attributes(&attributes); in mbedtls_pk_can_do_ext()
[all …]
Dpsa_crypto_ecp.c210 const psa_key_attributes_t *attributes, in mbedtls_psa_ecp_import_key() argument
219 status = mbedtls_psa_ecp_load_representation(attributes->type, in mbedtls_psa_ecp_import_key()
220 attributes->bits, in mbedtls_psa_ecp_import_key()
228 if (PSA_KEY_TYPE_ECC_GET_FAMILY(attributes->type) == in mbedtls_psa_ecp_import_key()
238 status = mbedtls_psa_ecp_export_key(attributes->type, in mbedtls_psa_ecp_import_key()
291 const psa_key_attributes_t *attributes, in mbedtls_psa_ecp_export_public_key() argument
299 attributes->type, attributes->bits, in mbedtls_psa_ecp_export_public_key()
307 PSA_KEY_TYPE_ECC_GET_FAMILY(attributes->type)), in mbedtls_psa_ecp_export_public_key()
321 const psa_key_attributes_t *attributes, in mbedtls_psa_ecp_generate_key() argument
328 attributes->type); in mbedtls_psa_ecp_generate_key()
[all …]
/mbedtls-latest/include/psa/
Dcrypto_struct.h335 static inline void psa_set_key_id(psa_key_attributes_t *attributes, in psa_set_key_id() argument
338 psa_key_lifetime_t lifetime = attributes->MBEDTLS_PRIVATE(lifetime); in psa_set_key_id()
340 attributes->MBEDTLS_PRIVATE(id) = key; in psa_set_key_id()
343 attributes->MBEDTLS_PRIVATE(lifetime) = in psa_set_key_id()
351 const psa_key_attributes_t *attributes) in psa_get_key_id() argument
353 return attributes->MBEDTLS_PRIVATE(id); in psa_get_key_id()
357 static inline void mbedtls_set_key_owner_id(psa_key_attributes_t *attributes, in mbedtls_set_key_owner_id() argument
360 attributes->MBEDTLS_PRIVATE(id).MBEDTLS_PRIVATE(owner) = owner; in mbedtls_set_key_owner_id()
364 static inline void psa_set_key_lifetime(psa_key_attributes_t *attributes, in psa_set_key_lifetime() argument
367 attributes->MBEDTLS_PRIVATE(lifetime) = lifetime; in psa_set_key_lifetime()
[all …]
Dcrypto.h136 static void psa_set_key_id(psa_key_attributes_t *attributes,
154 static void mbedtls_set_key_owner_id(psa_key_attributes_t *attributes,
184 static void psa_set_key_lifetime(psa_key_attributes_t *attributes,
200 const psa_key_attributes_t *attributes);
213 const psa_key_attributes_t *attributes);
231 static void psa_set_key_usage_flags(psa_key_attributes_t *attributes,
245 const psa_key_attributes_t *attributes);
277 static void psa_set_key_algorithm(psa_key_attributes_t *attributes,
292 const psa_key_attributes_t *attributes);
308 static void psa_set_key_type(psa_key_attributes_t *attributes,
[all …]
/mbedtls-latest/tests/src/
Dpsa_exercise_key.c45 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; in check_key_attributes_sanity() local
50 psa_status_t status = psa_get_key_attributes(key, &attributes); in check_key_attributes_sanity()
53 psa_reset_key_attributes(&attributes); in check_key_attributes_sanity()
57 lifetime = psa_get_key_lifetime(&attributes); in check_key_attributes_sanity()
58 id = psa_get_key_id(&attributes); in check_key_attributes_sanity()
59 type = psa_get_key_type(&attributes); in check_key_attributes_sanity()
60 bits = psa_get_key_bits(&attributes); in check_key_attributes_sanity()
79 status = psa_get_key_slot_number(&attributes, &slot_number); in check_key_attributes_sanity()
115 psa_reset_key_attributes(&attributes); in check_key_attributes_sanity()
183 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; in exercise_cipher_key() local
[all …]
/mbedtls-latest/programs/psa/
Dkey_ladder_demo.c189 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; in generate() local
191 psa_set_key_usage_flags(&attributes, in generate()
193 psa_set_key_algorithm(&attributes, KDF_ALG); in generate()
194 psa_set_key_type(&attributes, PSA_KEY_TYPE_DERIVE); in generate()
195 psa_set_key_bits(&attributes, PSA_BYTES_TO_BITS(KEY_SIZE_BYTES)); in generate()
197 PSA_CHECK(psa_generate_key(&attributes, &key)); in generate()
217 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; in import_key_from_file() local
237 psa_set_key_usage_flags(&attributes, usage); in import_key_from_file()
238 psa_set_key_algorithm(&attributes, alg); in import_key_from_file()
239 psa_set_key_type(&attributes, PSA_KEY_TYPE_DERIVE); in import_key_from_file()
[all …]
Dcrypto_examples.c156 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block() local
167 psa_set_key_usage_flags(&attributes, in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block()
169 psa_set_key_algorithm(&attributes, alg); in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block()
170 psa_set_key_type(&attributes, PSA_KEY_TYPE_AES); in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block()
171 psa_set_key_bits(&attributes, key_bits); in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block()
173 status = psa_generate_key(&attributes, &key); in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block()
206 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; in cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi() local
215 psa_set_key_usage_flags(&attributes, in cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi()
217 psa_set_key_algorithm(&attributes, alg); in cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi()
218 psa_set_key_type(&attributes, PSA_KEY_TYPE_AES); in cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi()
[all …]
/mbedtls-latest/scripts/data_files/driver_templates/
Dpsa_crypto_driver_wrappers.h.jinja113 const psa_key_attributes_t *attributes,
125 PSA_KEY_LIFETIME_GET_LOCATION( psa_get_key_lifetime(attributes) );
135 attributes,
156 attributes,
176 return( psa_sign_message_builtin( attributes,
188 const psa_key_attributes_t *attributes,
199 PSA_KEY_LIFETIME_GET_LOCATION( psa_get_key_lifetime(attributes) );
209 attributes,
229 attributes,
248 return( psa_verify_message_builtin( attributes,
[all …]
/mbedtls-latest/3rdparty/p256-m/
Dp256-m_driver_entrypoints.c61 psa_status_t p256_transparent_import_key(const psa_key_attributes_t *attributes, in p256_transparent_import_key() argument
75 psa_key_type_t type = psa_get_key_type(attributes); in p256_transparent_import_key()
106 psa_status_t p256_transparent_export_public_key(const psa_key_attributes_t *attributes, in p256_transparent_export_public_key() argument
114 size_t bits = psa_get_key_bits(attributes); in p256_transparent_export_public_key()
115 psa_key_type_t type = psa_get_key_type(attributes); in p256_transparent_export_public_key()
139 const psa_key_attributes_t *attributes, in p256_transparent_generate_key() argument
146 (void) attributes; in p256_transparent_generate_key()
169 const psa_key_attributes_t *attributes, in p256_transparent_key_agreement() argument
182 (void) attributes; in p256_transparent_key_agreement()
204 const psa_key_attributes_t *attributes, in p256_transparent_sign_hash() argument
[all …]

1234