Home
last modified time | relevance | path

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

1234

/openthread-latest/third_party/mbedtls/repo/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.function119 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
128 mbedtls_set_key_owner_id(&attributes, owner_id);
133 psa_set_key_usage_flags(&attributes, usage_flags);
134 psa_set_key_algorithm(&attributes, alg);
135 psa_set_key_type(&attributes, type);
136 PSA_ASSERT(psa_import_key(&attributes, key_data->x, key_data->len,
139 PSA_ASSERT(psa_get_key_attributes(key, &attributes));
140 TEST_EQUAL(psa_get_key_type(&attributes), type);
141 psa_reset_key_attributes(&attributes);
152 TEST_EQUAL(psa_get_key_attributes(key_with_invalid_owner, &attributes),
[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 …]
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_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_attributes.data1 PSA key attributes structure
5 PSA key attributes: id only
8 PSA key attributes: lifetime=3 only
11 PSA key attributes: id then back to volatile
14 PSA key attributes: id then back to non local volatile
17 PSA key attributes: id then lifetime
20 PSA key attributes: lifetime then id
23 PSA key attributes: non local volatile lifetime then id
26 PSA key attributes: slot number
Dtest_suite_psa_crypto_se_driver_hal.function133 const psa_key_attributes_t *attributes,
139 (void) attributes;
155 const psa_key_attributes_t *attributes,
160 (void) attributes;
178 const psa_key_attributes_t *attributes,
185 (void) attributes;
198 const psa_key_attributes_t *attributes,
205 (void) attributes;
208 if (!PSA_KEY_TYPE_IS_KEY_PAIR(psa_get_key_type(attributes))) {
268 const psa_key_attributes_t *attributes,
[all …]
Dtest_suite_psa_crypto_not_supported.function18 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
22 psa_set_key_type(&attributes, key_type);
23 TEST_EQUAL(psa_import_key(&attributes,
38 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
42 psa_set_key_type(&attributes, key_type);
43 psa_set_key_bits(&attributes, bits);
44 TEST_EQUAL(psa_generate_key(&attributes, &key_id),
Dtest_suite_psa_crypto.function186 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
188 psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_SIGN_HASH);
189 psa_set_key_algorithm(&attributes, alg);
190 psa_set_key_type(&attributes, key_type);
191 PSA_ASSERT(psa_import_key(&attributes, key_bytes, key_length, &key));
218 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
220 psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_ENCRYPT);
221 psa_set_key_algorithm(&attributes, alg);
222 psa_set_key_type(&attributes, key_type);
223 PSA_ASSERT(psa_import_key(&attributes, key_bytes, key_length, &key));
[all …]
/openthread-latest/third_party/mbedtls/repo/tests/src/drivers/
Dtest_driver_key_management.c192 const psa_key_attributes_t *attributes, in mbedtls_test_transparent_generate_key() argument
212 if (PSA_KEY_TYPE_IS_ECC(psa_get_key_type(attributes)) in mbedtls_test_transparent_generate_key()
213 && PSA_KEY_TYPE_IS_KEY_PAIR(psa_get_key_type(attributes))) { in mbedtls_test_transparent_generate_key()
217 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_generate_key()
221 attributes, key, key_size, key_length); in mbedtls_test_transparent_generate_key()
223 } else if (psa_get_key_type(attributes) == PSA_KEY_TYPE_RSA_KEY_PAIR) { in mbedtls_test_transparent_generate_key()
227 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_generate_key()
232 attributes, in mbedtls_test_transparent_generate_key()
236 } else if (PSA_KEY_TYPE_IS_DH(psa_get_key_type(attributes)) in mbedtls_test_transparent_generate_key()
237 && 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_key_agreement.c32 const psa_key_attributes_t *attributes, in mbedtls_test_transparent_key_agreement() argument
64 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_key_agreement()
71 attributes, in mbedtls_test_transparent_key_agreement()
77 (void) attributes; in mbedtls_test_transparent_key_agreement()
92 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_key_agreement()
99 attributes, in mbedtls_test_transparent_key_agreement()
108 (void) attributes; in mbedtls_test_transparent_key_agreement()
125 const psa_key_attributes_t *attributes, in mbedtls_test_opaque_key_agreement() argument
135 (void) attributes; in mbedtls_test_opaque_key_agreement()
Dtest_driver_asymmetric_encryption.c29 const psa_key_attributes_t *attributes, const uint8_t *key_buffer, in mbedtls_test_transparent_asymmetric_encrypt() argument
55 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_asymmetric_encrypt()
61 attributes, key_buffer, key_buffer_size, in mbedtls_test_transparent_asymmetric_encrypt()
70 const psa_key_attributes_t *attributes, const uint8_t *key_buffer, in mbedtls_test_transparent_asymmetric_decrypt() argument
96 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_transparent_asymmetric_decrypt()
102 attributes, key_buffer, key_buffer_size, in mbedtls_test_transparent_asymmetric_decrypt()
114 const psa_key_attributes_t *attributes, const uint8_t *key, in mbedtls_test_opaque_asymmetric_encrypt() argument
133 (const libtestdriver1_psa_key_attributes_t *) attributes, in mbedtls_test_opaque_asymmetric_encrypt()
139 attributes, unwrapped_key, unwrapped_key_length, in mbedtls_test_opaque_asymmetric_encrypt()
148 const psa_key_attributes_t *attributes, const uint8_t *key, in mbedtls_test_opaque_asymmetric_decrypt() 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 …]
/openthread-latest/third_party/mbedtls/repo/include/psa/
Dcrypto_struct.h309 static inline void psa_set_key_id(psa_key_attributes_t *attributes, in psa_set_key_id() argument
312 psa_key_lifetime_t lifetime = attributes->MBEDTLS_PRIVATE(lifetime); in psa_set_key_id()
314 attributes->MBEDTLS_PRIVATE(id) = key; in psa_set_key_id()
317 attributes->MBEDTLS_PRIVATE(lifetime) = in psa_set_key_id()
325 const psa_key_attributes_t *attributes) in psa_get_key_id() argument
327 return attributes->MBEDTLS_PRIVATE(id); in psa_get_key_id()
331 static inline void mbedtls_set_key_owner_id(psa_key_attributes_t *attributes, in mbedtls_set_key_owner_id() argument
334 attributes->MBEDTLS_PRIVATE(id).MBEDTLS_PRIVATE(owner) = owner; in mbedtls_set_key_owner_id()
338 static inline void psa_set_key_lifetime(psa_key_attributes_t *attributes, in psa_set_key_lifetime() argument
341 attributes->MBEDTLS_PRIVATE(lifetime) = lifetime; in psa_set_key_lifetime()
[all …]
/openthread-latest/third_party/mbedtls/repo/library/
Dpsa_crypto_driver_wrappers.h112 const psa_key_attributes_t *attributes, in psa_driver_wrapper_sign_message() argument
124 PSA_KEY_LIFETIME_GET_LOCATION( psa_get_key_lifetime(attributes) ); in psa_driver_wrapper_sign_message()
134 attributes, in psa_driver_wrapper_sign_message()
155 attributes, in psa_driver_wrapper_sign_message()
175 return( psa_sign_message_builtin( attributes, in psa_driver_wrapper_sign_message()
187 const psa_key_attributes_t *attributes, in psa_driver_wrapper_verify_message() argument
198 PSA_KEY_LIFETIME_GET_LOCATION( psa_get_key_lifetime(attributes) ); in psa_driver_wrapper_verify_message()
208 attributes, in psa_driver_wrapper_verify_message()
228 attributes, in psa_driver_wrapper_verify_message()
247 return( psa_verify_message_builtin( attributes, in psa_driver_wrapper_verify_message()
[all …]
Dpsa_crypto_driver_wrappers_no_static.c87 const psa_key_attributes_t *attributes, in psa_driver_wrapper_get_key_buffer_size() argument
90 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION( psa_get_key_lifetime(attributes) ); in psa_driver_wrapper_get_key_buffer_size()
91 psa_key_type_t key_type = psa_get_key_type(attributes); in psa_driver_wrapper_get_key_buffer_size()
92 size_t key_bits = psa_get_key_bits(attributes); in psa_driver_wrapper_get_key_buffer_size()
103 psa_get_key_id( attributes ) ) ) ) in psa_driver_wrapper_get_key_buffer_size()
123 const psa_key_attributes_t *attributes, in psa_driver_wrapper_export_public_key() argument
131 psa_get_key_lifetime( attributes ) ); in psa_driver_wrapper_export_public_key()
138 if( psa_get_se_driver( psa_get_key_lifetime(attributes), &drv, &drv_context ) ) in psa_driver_wrapper_export_public_key()
162 (attributes, in psa_driver_wrapper_export_public_key()
176 (attributes, in psa_driver_wrapper_export_public_key()
[all …]
/openthread-latest/third_party/mbedtls/repo/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 …]
/openthread-latest/third_party/mbedtls/repo/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 …]
/openthread-latest/third_party/mbedtls/repo/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 …]
/openthread-latest/third_party/mbedtls/repo/tests/include/test/drivers/
Dkey_management.h75 const psa_key_attributes_t *attributes,
79 const psa_key_attributes_t *attributes,
83 const psa_key_attributes_t *attributes,
88 const psa_key_attributes_t *attributes,
93 const psa_key_attributes_t *attributes,
98 const psa_key_attributes_t *attributes,
107 const psa_key_attributes_t *attributes,
117 psa_key_attributes_t *attributes,
121 psa_key_attributes_t *attributes,

1234