Home
last modified time | relevance | path

Searched refs:key_type (Results 1 – 25 of 50) sorted by relevance

12

/mbedtls-3.6.0/include/psa/
Dcrypto_sizes.h188 #define PSA_AEAD_TAG_LENGTH(key_type, key_bits, alg) \ argument
189 (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 ? \
318 #define PSA_MAC_LENGTH(key_type, key_bits, alg) \ argument
321 PSA_ALG_IS_BLOCK_CIPHER_MAC(alg) ? PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) : \
322 ((void) (key_type), (void) (key_bits), 0u))
350 #define PSA_AEAD_ENCRYPT_OUTPUT_SIZE(key_type, alg, plaintext_length) \ argument
351 (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 ? \
403 #define PSA_AEAD_DECRYPT_OUTPUT_SIZE(key_type, alg, ciphertext_length) \ argument
404 (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 && \
455 #define PSA_AEAD_NONCE_LENGTH(key_type, alg) \ argument
[all …]
Dcrypto_extra.h548 #define PSA_KEY_DOMAIN_PARAMETERS_SIZE(key_type, key_bits) \ argument
549 (PSA_KEY_TYPE_IS_RSA(key_type) ? sizeof(int) : \
550 PSA_KEY_TYPE_IS_DH(key_type) ? PSA_DH_KEY_DOMAIN_PARAMETERS_SIZE(key_bits) : \
551 PSA_KEY_TYPE_IS_DSA(key_type) ? PSA_DSA_KEY_DOMAIN_PARAMETERS_SIZE(key_bits) : \
/mbedtls-3.6.0/tests/scripts/
Dgenerate_psa_tests.py28 verb: str, key_type: str, bits: int,
38 short_key_type = crypto_knowledge.short_expression(key_type)
46 tc.set_arguments([key_type] + list(args))
121 for key_type in sorted(self.constructors.key_types):
122 if key_type in self.ECC_KEY_TYPES:
124 if key_type in self.DH_KEY_TYPES:
126 kt = crypto_knowledge.KeyType(key_type)
144 key_type: str, bits: int,
153 short_key_type = crypto_knowledge.short_expression(key_type)
158 tc.set_arguments([key_type] + list(args) + [result])
[all …]
/mbedtls-3.6.0/programs/psa/
Daead_demo.c126 psa_key_type_t key_type; in aead_prepare() local
130 key_type = PSA_KEY_TYPE_AES; in aead_prepare()
134 key_type = PSA_KEY_TYPE_AES; in aead_prepare()
138 key_type = PSA_KEY_TYPE_AES; in aead_prepare()
142 key_type = PSA_KEY_TYPE_CHACHA20; in aead_prepare()
152 psa_set_key_type(&attributes, key_type); in aead_prepare()
172 psa_key_type_t key_type = psa_get_key_type(&attr); in aead_info() local
175 size_t tag_len = PSA_AEAD_TAG_LENGTH(key_type, key_bits, alg); in aead_info()
177 const char *type_str = key_type == PSA_KEY_TYPE_AES ? "AES" in aead_info()
178 : key_type == PSA_KEY_TYPE_CHACHA20 ? "Chacha" in aead_info()
Dkey_ladder_demo.c354 psa_key_type_t key_type; in wrap_data() local
377 key_type = psa_get_key_type(&attributes); in wrap_data()
379 PSA_AEAD_ENCRYPT_OUTPUT_SIZE(key_type, WRAPPING_ALG, input_size); in wrap_data()
441 psa_key_type_t key_type; in unwrap_data() local
466 key_type = psa_get_key_type(&attributes); in unwrap_data()
468 PSA_AEAD_ENCRYPT_OUTPUT_SIZE(key_type, WRAPPING_ALG, header.payload_size); in unwrap_data()
/mbedtls-3.6.0/tests/suites/
Dtest_suite_psa_crypto_op_fail.function76 psa_key_type_t key_type = key_type_arg;
87 psa_set_key_type(&attributes, key_type);
122 psa_key_type_t key_type = key_type_arg;
133 psa_set_key_type(&attributes, key_type);
168 psa_key_type_t key_type = key_type_arg;
179 psa_set_key_type(&attributes, key_type);
217 psa_key_type_t key_type = key_type_arg;
234 psa_set_key_type(&attributes, key_type);
260 if (PSA_KEY_TYPE_IS_RSA(key_type)) {
262 } else if (PSA_KEY_TYPE_IS_ECC(key_type)) {
[all …]
Dtest_suite_psa_crypto_not_supported.function16 void import_not_supported(int key_type, data_t *key_material)
22 psa_set_key_type(&attributes, key_type);
36 void generate_not_supported(int key_type, int bits)
42 psa_set_key_type(&attributes, key_type);
Dtest_suite_psa_crypto.function173 int exercise_mac_setup(psa_key_type_t key_type,
185 psa_set_key_type(&attributes, key_type);
205 int exercise_cipher_setup(psa_key_type_t key_type,
217 psa_set_key_type(&attributes, key_type);
361 psa_key_type_t key_type = key_type_arg;
396 psa_set_key_type(&attributes, key_type);
404 tag_length = PSA_AEAD_TAG_LENGTH(key_type, key_bits, alg);
408 output_size = PSA_AEAD_UPDATE_OUTPUT_SIZE(key_type, alg,
413 output_size = PSA_AEAD_UPDATE_OUTPUT_SIZE(key_type, alg,
424 final_output_size = PSA_AEAD_FINISH_OUTPUT_SIZE(key_type, alg);
[all …]
Dtest_suite_psa_crypto_driver_wrappers.function508 psa_key_type_t key_type = key_type_arg;
518 key_type);
537 signature_size = PSA_SIGN_OUTPUT_SIZE(key_type, key_bits, alg);
578 psa_key_type_t key_type = key_type_arg;
595 psa_set_key_type(&attributes, key_type);
636 psa_key_type_t key_type = key_type_arg;
645 psa_set_key_type(&attributes, key_type);
664 signature_size = PSA_SIGN_OUTPUT_SIZE(key_type, key_bits, alg);
707 psa_key_type_t key_type = key_type_arg;
724 psa_set_key_type(&attributes, key_type);
[all …]
Dtest_suite_psa_crypto_generate_key.function22 psa_key_type_t key_type = key_type_arg;
27 psa_set_key_type(&attributes, key_type);
39 TEST_EQUAL(psa_get_key_type(&attributes), key_type);
Dtest_suite_psa_crypto_metadata.function196 psa_key_type_t key_type, size_t key_bits,
212 TEST_EQUAL(length, PSA_MAC_LENGTH(key_type, key_bits, alg));
215 PSA_ASSERT(psa_mac_key_can_do(alg, key_type));
222 psa_key_type_t key_type, size_t key_bits,
238 TEST_EQUAL(tag_length, PSA_AEAD_TAG_LENGTH(key_type, key_bits, alg));
302 size_t key_type = key_type_arg;
306 key_type, key_bits, length);
314 key_type, key_bits, n);
345 key_type, key_bits, n);
428 psa_key_type_t key_type = key_type_arg;
[all …]
Dtest_suite_psa_crypto_metadata.data357 key_type:PSA_KEY_TYPE_RAW_DATA:KEY_TYPE_IS_UNSTRUCTURED
361 key_type:PSA_KEY_TYPE_HMAC:KEY_TYPE_IS_UNSTRUCTURED
364 key_type:PSA_KEY_TYPE_DERIVE:KEY_TYPE_IS_UNSTRUCTURED
367 key_type:PSA_KEY_TYPE_PASSWORD:KEY_TYPE_IS_UNSTRUCTURED
370 key_type:PSA_KEY_TYPE_PASSWORD_HASH:KEY_TYPE_IS_UNSTRUCTURED
394 key_type:PSA_KEY_TYPE_RSA_PUBLIC_KEY:KEY_TYPE_IS_PUBLIC_KEY | KEY_TYPE_IS_RSA
398 key_type:PSA_KEY_TYPE_RSA_KEY_PAIR:KEY_TYPE_IS_KEY_PAIR | KEY_TYPE_IS_RSA
Dtest_suite_psa_crypto_hash.function44 psa_key_type_t key_type = PSA_KEY_TYPE_HMAC;
56 psa_set_key_type(&attributes, key_type);
/mbedtls-3.6.0/tests/src/drivers/
Dtest_driver_key_management.c100 const psa_key_type_t key_type, in mbedtls_test_opaque_size_function() argument
105 key_buffer_size = PSA_EXPORT_KEY_OUTPUT_SIZE(key_type, key_bits); in mbedtls_test_opaque_size_function()
548 psa_key_type_t key_type = psa_get_key_type(attributes); in mbedtls_test_transparent_export_public_key() local
550 if (PSA_KEY_TYPE_IS_ECC(key_type)) { in mbedtls_test_transparent_export_public_key()
565 } else if (PSA_KEY_TYPE_IS_RSA(key_type)) { in mbedtls_test_transparent_export_public_key()
580 } else if (PSA_KEY_TYPE_IS_DH(key_type)) { in mbedtls_test_transparent_export_public_key()
599 (void) key_type; in mbedtls_test_transparent_export_public_key()
611 psa_key_type_t key_type = psa_get_key_type(attributes); in mbedtls_test_opaque_export_public_key() local
619 if (PSA_KEY_TYPE_IS_ECC(key_type)) { in mbedtls_test_opaque_export_public_key()
640 } else if (PSA_KEY_TYPE_IS_RSA(key_type)) { in mbedtls_test_opaque_export_public_key()
[all …]
/mbedtls-3.6.0/library/
Dssl_ticket.c91 psa_set_key_type(&attributes, key->key_type); in ssl_ticket_gen_key()
179 psa_set_key_type(&attributes, key->key_type); in mbedtls_ssl_ticket_rotate()
217 psa_key_type_t key_type; in mbedtls_ssl_ticket_setup() local
224 &alg, &key_type, &key_bits) != PSA_SUCCESS) { in mbedtls_ssl_ticket_setup()
254 ctx->keys[0].key_type = key_type; in mbedtls_ssl_ticket_setup()
258 ctx->keys[1].key_type = key_type; in mbedtls_ssl_ticket_setup()
Dpsa_crypto_cipher.c24 psa_key_type_t key_type, in mbedtls_cipher_info_from_psa() argument
101 switch (key_type) { in mbedtls_cipher_info_from_psa()
162 psa_key_type_t key_type = attributes->core.type; in psa_cipher_setup() local
170 cipher_info = mbedtls_cipher_info_from_psa(alg, key_type, in psa_cipher_setup()
182 if (key_type == PSA_KEY_TYPE_DES && key_bits == 128) { in psa_cipher_setup()
223 PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type)); in psa_cipher_setup()
224 operation->iv_length = PSA_CIPHER_IV_LENGTH(key_type, alg); in psa_cipher_setup()
Dpsa_crypto_driver_wrappers_no_static.c120 psa_key_type_t key_type = attributes->core.type; in psa_driver_wrapper_get_key_buffer_size() local
138 *key_buffer_size = mbedtls_test_opaque_size_function( key_type, in psa_driver_wrapper_get_key_buffer_size()
151 (void)key_type; in psa_driver_wrapper_get_key_buffer_size()
Dssl_tls13_generic.c1522 uint16_t tls_id, size_t *bits, psa_key_type_t *key_type) in mbedtls_ssl_get_psa_ffdh_info_from_tls_id() argument
1527 *key_type = PSA_KEY_TYPE_DH_KEY_PAIR(PSA_DH_FAMILY_RFC7919); in mbedtls_ssl_get_psa_ffdh_info_from_tls_id()
1531 *key_type = PSA_KEY_TYPE_DH_KEY_PAIR(PSA_DH_FAMILY_RFC7919); in mbedtls_ssl_get_psa_ffdh_info_from_tls_id()
1535 *key_type = PSA_KEY_TYPE_DH_KEY_PAIR(PSA_DH_FAMILY_RFC7919); in mbedtls_ssl_get_psa_ffdh_info_from_tls_id()
1539 *key_type = PSA_KEY_TYPE_DH_KEY_PAIR(PSA_DH_FAMILY_RFC7919); in mbedtls_ssl_get_psa_ffdh_info_from_tls_id()
1543 *key_type = PSA_KEY_TYPE_DH_KEY_PAIR(PSA_DH_FAMILY_RFC7919); in mbedtls_ssl_get_psa_ffdh_info_from_tls_id()
1564 psa_key_type_t key_type = PSA_KEY_TYPE_NONE; in mbedtls_ssl_tls13_generate_and_write_xxdh_key_exchange() local
1573 named_group, &key_type, &bits) == PSA_SUCCESS) { in mbedtls_ssl_tls13_generate_and_write_xxdh_key_exchange()
1579 &key_type) == PSA_SUCCESS) { in mbedtls_ssl_tls13_generate_and_write_xxdh_key_exchange()
1584 if (key_type == PSA_KEY_TYPE_NONE) { in mbedtls_ssl_tls13_generate_and_write_xxdh_key_exchange()
[all …]
Dpsa_crypto.c488 psa_key_type_t key_type) in psa_mac_key_can_do() argument
491 if (key_type == PSA_KEY_TYPE_HMAC) { in psa_mac_key_can_do()
499 if ((key_type & PSA_KEY_TYPE_CATEGORY_MASK) == in psa_mac_key_can_do()
503 if (PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) > 1) { in psa_mac_key_can_do()
620 psa_key_type_t key_type, in psa_key_policy_algorithm_intersection() argument
674 if (PSA_SUCCESS != psa_mac_key_can_do(alg1, key_type)) { in psa_key_policy_algorithm_intersection()
686 size_t alg1_len = PSA_MAC_LENGTH(key_type, 0, alg1); in psa_key_policy_algorithm_intersection()
687 size_t alg2_len = PSA_MAC_LENGTH(key_type, 0, alg2); in psa_key_policy_algorithm_intersection()
718 static int psa_key_algorithm_permits(psa_key_type_t key_type, in psa_key_algorithm_permits() argument
753 if (PSA_SUCCESS != psa_mac_key_can_do(policy_alg, key_type)) { in psa_key_algorithm_permits()
[all …]
Dssl_tls.c2696 psa_key_type_t *key_type, in mbedtls_ssl_cipher_to_psa() argument
2702 *key_type = PSA_KEY_TYPE_AES; in mbedtls_ssl_cipher_to_psa()
2707 *key_type = PSA_KEY_TYPE_AES; in mbedtls_ssl_cipher_to_psa()
2712 *key_type = PSA_KEY_TYPE_AES; in mbedtls_ssl_cipher_to_psa()
2717 *key_type = PSA_KEY_TYPE_AES; in mbedtls_ssl_cipher_to_psa()
2722 *key_type = PSA_KEY_TYPE_AES; in mbedtls_ssl_cipher_to_psa()
2727 *key_type = PSA_KEY_TYPE_AES; in mbedtls_ssl_cipher_to_psa()
2732 *key_type = PSA_KEY_TYPE_AES; in mbedtls_ssl_cipher_to_psa()
2737 *key_type = PSA_KEY_TYPE_AES; in mbedtls_ssl_cipher_to_psa()
2742 *key_type = PSA_KEY_TYPE_ARIA; in mbedtls_ssl_cipher_to_psa()
[all …]
Dpsa_crypto_invasive.h67 psa_key_type_t key_type);
/mbedtls-3.6.0/tests/include/test/
Dpsa_crypto_helpers.h263 #define MBEDTLS_TEST_PSA_SKIP_IF_ALT_AES_192(key_type, key_bits) \ argument
267 ((key_type) == PSA_KEY_TYPE_AES) && \
/mbedtls-3.6.0/tests/src/
Dpsa_exercise_key.c151 psa_key_type_t key_type; in exercise_cipher_key() local
159 key_type = psa_get_key_type(&attributes); in exercise_cipher_key()
160 iv_length = PSA_CIPHER_IV_LENGTH(key_type, alg); in exercise_cipher_key()
225 psa_key_type_t key_type; in exercise_aead_key() local
237 key_type = psa_get_key_type(&attributes); in exercise_aead_key()
238 nonce_length = PSA_AEAD_NONCE_LENGTH(key_type, alg); in exercise_aead_key()
/mbedtls-3.6.0/scripts/data_files/driver_templates/
Dpsa_crypto_driver_wrappers_no_static.c.jinja92 psa_key_type_t key_type = attributes->core.type;
110 *key_buffer_size = mbedtls_test_opaque_size_function( key_type,
117 (void)key_type;
/mbedtls-3.6.0/programs/ssl/
Dssl_test_lib.c227 mbedtls_pk_type_t key_type) in key_opaque_set_alg_usage() argument
263 if (key_type == MBEDTLS_PK_ECKEY) { in key_opaque_set_alg_usage()
267 } else if (key_type == MBEDTLS_PK_RSA) { in key_opaque_set_alg_usage()

12