/mbedtls-3.5.0/library/ |
D | lms.c | 72 #define MERKLE_TREE_NODE_AM(type) ((size_t) 1 << (MBEDTLS_LMS_H_TREE_HEIGHT(type) + 1u)) argument 73 #define MERKLE_TREE_LEAF_NODE_AM(type) ((size_t) 1 << MBEDTLS_LMS_H_TREE_HEIGHT(type)) argument 74 #define MERKLE_TREE_INTERNAL_NODE_AM(type) ((size_t) 1 << MBEDTLS_LMS_H_TREE_HEIGHT(type)) argument 138 status = psa_hash_finish(&op, out, MBEDTLS_LMS_M_NODE_BYTES(params->type), in create_merkle_leaf_value() 207 MBEDTLS_LMS_M_NODE_BYTES(params->type)); in create_merkle_internal_value() 213 MBEDTLS_LMS_M_NODE_BYTES(params->type)); in create_merkle_internal_value() 218 status = psa_hash_finish(&op, out, MBEDTLS_LMS_M_NODE_BYTES(params->type), in create_merkle_internal_value() 243 mbedtls_lms_algorithm_type_t type; in mbedtls_lms_import_public_key() local 246 type = mbedtls_lms_network_bytes_to_unsigned_int(MBEDTLS_LMS_TYPE_LEN, in mbedtls_lms_import_public_key() 248 if (type != MBEDTLS_LMS_SHA256_M32_H10) { in mbedtls_lms_import_public_key() [all …]
|
D | lmots.c | 118 for (idx = 0; idx < MBEDTLS_LMOTS_N_HASH_LEN(params->type); idx++) { in lmots_checksum_calculate() 182 MBEDTLS_LMOTS_C_RANDOM_VALUE_LEN(params->type)); in create_digit_array_with_checksum() 193 MBEDTLS_LMOTS_N_HASH_LEN(params->type), in create_digit_array_with_checksum() 201 out + MBEDTLS_LMOTS_N_HASH_LEN(params->type)); in create_digit_array_with_checksum() 256 i_digit_idx < MBEDTLS_LMOTS_P_SIG_DIGIT_COUNT(params->type); in hash_digit_array() 260 &x_digit_array[i_digit_idx * MBEDTLS_LMOTS_N_HASH_LEN(params->type)], in hash_digit_array() 261 MBEDTLS_LMOTS_N_HASH_LEN(params->type)); in hash_digit_array() 307 MBEDTLS_LMOTS_N_HASH_LEN(params->type)); in hash_digit_array() 321 memcpy(&output[i_digit_idx * MBEDTLS_LMOTS_N_HASH_LEN(params->type)], in hash_digit_array() 322 tmp_hash, MBEDTLS_LMOTS_N_HASH_LEN(params->type)); in hash_digit_array() [all …]
|
D | psa_crypto_ecp.c | 46 psa_key_type_t type, size_t curve_bits, in mbedtls_psa_ecp_load_representation() argument 56 if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type) && in mbedtls_psa_ecp_load_representation() 57 PSA_KEY_TYPE_ECC_GET_FAMILY(type) != PSA_ECC_FAMILY_MONTGOMERY) { in mbedtls_psa_ecp_load_representation() 96 grp_id = mbedtls_ecc_group_of_psa(PSA_KEY_TYPE_ECC_GET_FAMILY(type), in mbedtls_psa_ecp_load_representation() 116 if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type)) { in mbedtls_psa_ecp_load_representation() 172 status = mbedtls_psa_ecp_load_representation(attributes->core.type, in mbedtls_psa_ecp_import_key() 181 if (PSA_KEY_TYPE_ECC_GET_FAMILY(attributes->core.type) == in mbedtls_psa_ecp_import_key() 191 status = mbedtls_psa_ecp_export_key(attributes->core.type, in mbedtls_psa_ecp_import_key() 204 psa_status_t mbedtls_psa_ecp_export_key(psa_key_type_t type, in mbedtls_psa_ecp_export_key() argument 212 if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type)) { in mbedtls_psa_ecp_export_key() [all …]
|
D | pk_wrap.c | 188 static int rsa_can_do(mbedtls_pk_type_t type) in rsa_can_do() argument 190 return type == MBEDTLS_PK_RSA || in rsa_can_do() 191 type == MBEDTLS_PK_RSASSA_PSS; in rsa_can_do() 605 items->type = MBEDTLS_PK_DEBUG_MPI; in rsa_debug() 611 items->type = MBEDTLS_PK_DEBUG_MPI; in rsa_debug() 645 static int eckey_can_do(mbedtls_pk_type_t type) in eckey_can_do() argument 647 return type == MBEDTLS_PK_ECKEY || in eckey_can_do() 648 type == MBEDTLS_PK_ECKEY_DH || in eckey_can_do() 649 type == MBEDTLS_PK_ECDSA; in eckey_can_do() 1126 items->type = MBEDTLS_PK_DEBUG_ECP; in eckey_debug() [all …]
|
D | lmots.h | 39 #define MBEDTLS_LMOTS_PUBLIC_KEY_LEN(type) (MBEDTLS_LMOTS_TYPE_LEN + \ argument 42 MBEDTLS_LMOTS_N_HASH_LEN(type)) 47 #define MBEDTLS_LMOTS_SIG_SIGNATURE_OFFSET(type) (MBEDTLS_LMOTS_SIG_C_RANDOM_OFFSET + \ argument 48 MBEDTLS_LMOTS_C_RANDOM_VALUE_LEN(type)) 261 mbedtls_lmots_algorithm_type_t type,
|
D | psa_crypto_storage.h | 287 psa_crypto_transaction_type_t type; member 296 psa_crypto_transaction_type_t type; member 315 psa_crypto_transaction_type_t type) in psa_crypto_prepare_transaction() argument 317 psa_crypto_transaction.unknown.type = type; in psa_crypto_prepare_transaction()
|
D | pk.c | 162 psa_key_type_t type; in mbedtls_pk_setup_opaque() local 171 type = psa_get_key_type(&attributes); in mbedtls_pk_setup_opaque() 174 if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(type)) { in mbedtls_pk_setup_opaque() 176 } else if (type == PSA_KEY_TYPE_RSA_KEY_PAIR) { in mbedtls_pk_setup_opaque() 231 int mbedtls_pk_can_do(const mbedtls_pk_context *ctx, mbedtls_pk_type_t type) in mbedtls_pk_can_do() argument 240 return ctx->pk_info->can_do(type); in mbedtls_pk_can_do() 283 mbedtls_pk_type_t type; in mbedtls_pk_can_do_ext() local 286 type = MBEDTLS_PK_ECKEY; in mbedtls_pk_can_do_ext() 289 type = MBEDTLS_PK_RSA; in mbedtls_pk_can_do_ext() 291 type = MBEDTLS_PK_RSASSA_PSS; in mbedtls_pk_can_do_ext() [all …]
|
D | psa_crypto_rsa.c | 72 psa_key_type_t type, const uint8_t *data, size_t data_length, in mbedtls_psa_rsa_load_representation() argument 81 if (PSA_KEY_TYPE_IS_KEY_PAIR(type)) { in mbedtls_psa_rsa_load_representation() 142 status = mbedtls_psa_rsa_load_representation(attributes->core.type, in mbedtls_psa_rsa_import_key() 156 status = mbedtls_psa_rsa_export_key(attributes->core.type, in mbedtls_psa_rsa_import_key() 169 psa_status_t mbedtls_psa_rsa_export_key(psa_key_type_t type, in mbedtls_psa_rsa_export_key() argument 186 if (PSA_KEY_TYPE_IS_KEY_PAIR(type)) { in mbedtls_psa_rsa_export_key() 222 attributes->core.type, key_buffer, key_buffer_size, &rsa); in mbedtls_psa_rsa_export_public_key() 297 status = mbedtls_psa_rsa_export_key(attributes->core.type, in mbedtls_psa_rsa_generate_key() 354 status = mbedtls_psa_rsa_load_representation(attributes->core.type, in mbedtls_psa_rsa_sign_hash() 453 status = mbedtls_psa_rsa_load_representation(attributes->core.type, in mbedtls_psa_rsa_verify_hash() [all …]
|
D | md.c | 170 switch (info->type) { in psa_alg_of_md() 247 switch (ctx->md_info->type) { in mbedtls_md_free() 325 switch (src->md_info->type) { in mbedtls_md_clone() 368 #define ALLOC(type) \ argument 370 ctx->md_ctx = mbedtls_calloc(1, sizeof(mbedtls_##type##_context)); \ 373 mbedtls_##type##_init(ctx->md_ctx); \ 402 switch (md_info->type) { in mbedtls_md_setup() 471 switch (ctx->md_info->type) { in mbedtls_md_starts() 518 switch (ctx->md_info->type) { in mbedtls_md_update() 567 switch (ctx->md_info->type) { in mbedtls_md_finish() [all …]
|
D | psa_crypto.c | 106 static int key_type_is_raw_bytes(psa_key_type_t type) in key_type_is_raw_bytes() argument 108 return PSA_KEY_TYPE_IS_UNSTRUCTURED(type); in key_type_is_raw_bytes() 487 psa_status_t psa_validate_unstructured_key_bit_size(psa_key_type_t type, in psa_validate_unstructured_key_bit_size() argument 491 switch (type) { in psa_validate_unstructured_key_bit_size() 620 psa_key_type_t type = attributes->core.type; in psa_import_key_into_slot() local 627 if (key_type_is_raw_bytes(type)) { in psa_import_key_into_slot() 630 status = psa_validate_unstructured_key_bit_size(attributes->core.type, in psa_import_key_into_slot() 642 } else if (PSA_KEY_TYPE_IS_ASYMMETRIC(type)) { in psa_import_key_into_slot() 645 if (PSA_KEY_TYPE_IS_ECC(type)) { in psa_import_key_into_slot() 656 if (PSA_KEY_TYPE_IS_RSA(type)) { in psa_import_key_into_slot() [all …]
|
D | cipher.c | 73 int *type; in mbedtls_cipher_list() local 77 type = mbedtls_cipher_supported; in mbedtls_cipher_list() 79 while (def->type != 0) { in mbedtls_cipher_list() 80 *type++ = (*def++).type; in mbedtls_cipher_list() 83 *type = 0; in mbedtls_cipher_list() 97 if (def->type == cipher_type) { in mbedtls_cipher_info_from_type() 235 if (mbedtls_psa_translate_cipher_type(cipher_info->type) == 0) { in mbedtls_cipher_setup_psa() 288 ctx->cipher_info->type); in mbedtls_cipher_setkey() 387 if (ctx->cipher_info->type == MBEDTLS_CIPHER_CHACHA20) { in mbedtls_cipher_set_iv() 402 if (ctx->cipher_info->type == MBEDTLS_CIPHER_CHACHA20_POLY1305 && in mbedtls_cipher_set_iv() [all …]
|
/mbedtls-3.5.0/include/mbedtls/ |
D | lms.h | 45 #define MBEDTLS_LMOTS_N_HASH_LEN(type) ((type) == MBEDTLS_LMOTS_SHA256_N32_W8 ? 32u : 0) argument 49 #define MBEDTLS_LMOTS_P_SIG_DIGIT_COUNT(type) ((type) == MBEDTLS_LMOTS_SHA256_N32_W8 ? 34u : 0) argument 50 #define MBEDTLS_LMOTS_C_RANDOM_VALUE_LEN(type) (MBEDTLS_LMOTS_N_HASH_LEN(type)) argument 52 #define MBEDTLS_LMOTS_SIG_LEN(type) (MBEDTLS_LMOTS_TYPE_LEN + \ argument 53 MBEDTLS_LMOTS_C_RANDOM_VALUE_LEN(type) + \ 54 (MBEDTLS_LMOTS_P_SIG_DIGIT_COUNT(type) * \ 55 MBEDTLS_LMOTS_N_HASH_LEN(type))) 59 #define MBEDTLS_LMS_H_TREE_HEIGHT(type) ((type) == MBEDTLS_LMS_SHA256_M32_H10 ? 10u : 0) argument 64 #define MBEDTLS_LMS_M_NODE_BYTES(type) ((type) == MBEDTLS_LMS_SHA256_M32_H10 ? 32 : 0) argument 67 #define MBEDTLS_LMS_SIG_LEN(type, otstype) (MBEDTLS_LMOTS_Q_LEAF_ID_LEN + \ argument [all …]
|
/mbedtls-3.5.0/tests/suites/ |
D | test_suite_psa_crypto_storage_format.current.data | 107 save type: AES 128-bit 111 save type: AES 128-bit, AEAD_SHORT(CCM,4) 115 save type: AES 128-bit, AEAD_SHORT(CCM,14) 119 save type: AES 128-bit, AEAD_SHORT(CCM,16) 123 save type: AES 128-bit, CBC_MAC 127 save type: AES 128-bit, CBC_NO_PADDING 131 save type: AES 128-bit, CBC_PKCS7 135 save type: AES 128-bit, CCM 139 save type: AES 128-bit, CCM_STAR_NO_TAG 143 save type: AES 128-bit, CFB [all …]
|
D | test_suite_psa_crypto_storage_format.v0.data | 195 read type: AES 128-bit 199 read type: AES 128-bit, AEAD_SHORT(CCM,4) 203 read type: AES 128-bit, AEAD_SHORT(CCM,14) 207 read type: AES 128-bit, AEAD_SHORT(CCM,16) 211 read type: AES 128-bit, CBC_MAC 215 read type: AES 128-bit, CBC_NO_PADDING 219 read type: AES 128-bit, CBC_PKCS7 223 read type: AES 128-bit, CCM 227 read type: AES 128-bit, CCM_STAR_NO_TAG 231 read type: AES 128-bit, CFB [all …]
|
D | test_suite_psa_crypto_not_supported.generated.data | 147 PSA import ECC_KEY_PAIR(BRAINPOOL_P_R1) 160-bit type not supported 151 PSA generate ECC_KEY_PAIR(BRAINPOOL_P_R1) 160-bit type not supported 155 PSA import ECC_KEY_PAIR(BRAINPOOL_P_R1) 192-bit type not supported 159 PSA generate ECC_KEY_PAIR(BRAINPOOL_P_R1) 192-bit type not supported 163 PSA import ECC_KEY_PAIR(BRAINPOOL_P_R1) 224-bit type not supported 167 PSA generate ECC_KEY_PAIR(BRAINPOOL_P_R1) 224-bit type not supported 171 PSA import ECC_KEY_PAIR(BRAINPOOL_P_R1) 256-bit type not supported 175 PSA generate ECC_KEY_PAIR(BRAINPOOL_P_R1) 256-bit type not supported 179 PSA import ECC_KEY_PAIR(BRAINPOOL_P_R1) 320-bit type not supported 183 PSA generate ECC_KEY_PAIR(BRAINPOOL_P_R1) 320-bit type not supported [all …]
|
D | test_suite_psa_crypto_metadata.function | 51 /* Flags for key type classification macros. There is a flag for every 52 * key type classification macro PSA_KEY_TYPE_IS_xxx except for some that 158 void key_type_classification(psa_key_type_t type, unsigned flags) 163 TEST_CLASSIFICATION_MACRO(1, KEY_TYPE_IS_VENDOR_DEFINED, type, flags); 164 TEST_CLASSIFICATION_MACRO(1, KEY_TYPE_IS_UNSTRUCTURED, type, flags); 165 TEST_CLASSIFICATION_MACRO(1, KEY_TYPE_IS_PUBLIC_KEY, type, flags); 166 TEST_CLASSIFICATION_MACRO(1, KEY_TYPE_IS_KEY_PAIR, type, flags); 167 TEST_CLASSIFICATION_MACRO(1, KEY_TYPE_IS_RSA, type, flags); 168 TEST_CLASSIFICATION_MACRO(1, KEY_TYPE_IS_DSA, type, flags); 169 TEST_CLASSIFICATION_MACRO(1, KEY_TYPE_IS_ECC, type, flags); [all …]
|
D | test_suite_lms.data | 189 LMS negative test (invalid lms type) #1 191 # LMOTS type (0x4) but an invalid LMS type (0x5), and should fail. 194 LMS negative test (invalid lms type) #2 196 # LMOTS type (0x4) but an invalid LMS type (0x7), and should fail. 199 LMS negative test (invalid lm_ots type) #1 201 # invalid LMOTS type (0x3) but a valid LMS type (0x6), and should fail. 204 LMS negative test (invalid lm_ots type) #2 206 # invalid LMOTS type (0x5) but a valid LMS type (0x6), and should fail. 231 LMS key import no LMS type test 233 # it's smaller than the LMS type offset, and imports it. This should fail, and [all …]
|
/mbedtls-3.5.0/include/psa/ |
D | crypto_values.h | 386 #define PSA_KEY_TYPE_IS_VENDOR_DEFINED(type) \ argument 387 (((type) & PSA_KEY_TYPE_VENDOR_FLAG) != 0) 393 #define PSA_KEY_TYPE_IS_UNSTRUCTURED(type) \ argument 394 (((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_RAW || \ 395 ((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_SYMMETRIC) 398 #define PSA_KEY_TYPE_IS_ASYMMETRIC(type) \ argument 399 (((type) & PSA_KEY_TYPE_CATEGORY_MASK \ 403 #define PSA_KEY_TYPE_IS_PUBLIC_KEY(type) \ argument 404 (((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY) 407 #define PSA_KEY_TYPE_IS_KEY_PAIR(type) \ argument [all …]
|
D | crypto_struct.h | 332 psa_key_type_t MBEDTLS_PRIVATE(type); 453 psa_key_type_t type, 458 psa_key_type_t type) in psa_set_key_type() argument 462 attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(type) = type; in psa_set_key_type() 468 (void) psa_set_key_domain_parameters(attributes, type, NULL, 0); in psa_set_key_type() 475 return attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(type); in psa_get_key_type()
|
/mbedtls-3.5.0/tests/src/ |
D | psa_exercise_key.c | 49 psa_key_type_t type; in check_key_attributes_sanity() local 55 type = psa_get_key_type(&attributes); in check_key_attributes_sanity() 86 TEST_ASSERT(type != 0); in check_key_attributes_sanity() 89 if (PSA_KEY_TYPE_IS_UNSTRUCTURED(type)) { in check_key_attributes_sanity() 94 if (PSA_KEY_TYPE_IS_ECC(type)) { in check_key_attributes_sanity() 96 } else if (PSA_KEY_TYPE_IS_RSA(type)) { in check_key_attributes_sanity() 99 TEST_ASSERT(PSA_BLOCK_CIPHER_BLOCK_LENGTH(type) <= PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE); in check_key_attributes_sanity() 665 psa_key_type_t type, size_t bits, in mbedtls_test_psa_exported_key_sanity_check() argument 668 TEST_ASSERT(exported_length <= PSA_EXPORT_KEY_OUTPUT_SIZE(type, bits)); in mbedtls_test_psa_exported_key_sanity_check() 670 if (PSA_KEY_TYPE_IS_UNSTRUCTURED(type)) { in mbedtls_test_psa_exported_key_sanity_check() [all …]
|
/mbedtls-3.5.0/programs/cipher/ |
D | cipher_aead_demo.c | 133 mbedtls_cipher_type_t type; in aead_prepare() local 135 type = MBEDTLS_CIPHER_AES_128_GCM; in aead_prepare() 138 type = MBEDTLS_CIPHER_AES_256_GCM; in aead_prepare() 141 type = MBEDTLS_CIPHER_AES_128_GCM; in aead_prepare() 144 type = MBEDTLS_CIPHER_CHACHA20_POLY1305; in aead_prepare() 153 mbedtls_cipher_info_from_type(type))); in aead_prepare() 171 mbedtls_cipher_type_t type = mbedtls_cipher_get_type(ctx); in aead_info() local 172 const mbedtls_cipher_info_t *info = mbedtls_cipher_info_from_type(type); in aead_info()
|
/mbedtls-3.5.0/programs/test/ |
D | udp_proxy.c | 493 const char *type; member 504 elapsed_time(), p->way, p->type, p->len); in print_packet() 507 elapsed_time(), p->way, p->type, p->len, why); in print_packet() 512 p->way, p->type, p->len); in print_packet() 515 p->way, p->type, p->len, why); in print_packet() 551 strcmp(p->type, "ClientHello") == 0) { in send_packet() 558 strcmp(p->type, "CID") == 0 && in send_packet() 575 strcmp(p->type, "ApplicationData") == 0) { in send_packet() 600 strcmp(p->type, "ApplicationData") != 0 && in send_packet() 613 strcmp(p->type, "ApplicationData") == 0) { in send_packet() [all …]
|
/mbedtls-3.5.0/scripts/mbedtls_dev/ |
D | psa_storage.py | 113 type: Exprable, #pylint: disable=redefined-builtin 121 self.type = as_expr(type) #type: Expr 163 self.lifetime, self.type, self.bits, 189 type=0x2400, bits=128, 200 type='PSA_KEY_TYPE_RAW_DATA', bits=length*8, 208 key = Key(type=0x1001, bits=8,
|
/mbedtls-3.5.0/tests/src/drivers/ |
D | test_driver_key_management.c | 269 psa_key_type_t type = psa_get_key_type(attributes); in mbedtls_test_transparent_import_key() local 278 if (PSA_KEY_TYPE_IS_ECC(type)) { in mbedtls_test_transparent_import_key() 295 } else if (PSA_KEY_TYPE_IS_RSA(type)) { in mbedtls_test_transparent_import_key() 320 (void) type; in mbedtls_test_transparent_import_key() 336 psa_key_type_t type = psa_get_key_type(attributes); in mbedtls_test_opaque_import_key() local 353 if (PSA_KEY_TYPE_IS_UNSTRUCTURED(type)) { in mbedtls_test_opaque_import_key() 356 status = psa_validate_unstructured_key_bit_size(type, in mbedtls_test_opaque_import_key() 369 } else if (PSA_KEY_TYPE_IS_ECC(type)) { in mbedtls_test_opaque_import_key() 391 } else if (PSA_KEY_TYPE_IS_RSA(type)) { in mbedtls_test_opaque_import_key() 496 psa_key_type_t type = psa_get_key_type(attributes); in mbedtls_test_opaque_export_key() local [all …]
|
/mbedtls-3.5.0/programs/pkey/ |
D | gen_key.c | 129 int type; /* the type of key to generate */ member 217 opt.type = DFL_TYPE; in main() 233 opt.type = MBEDTLS_PK_RSA; in main() 235 opt.type = MBEDTLS_PK_ECKEY; in main() 308 mbedtls_pk_info_from_type((mbedtls_pk_type_t) opt.type))) != 0) { in main() 314 if (opt.type == MBEDTLS_PK_RSA) { in main() 325 if (opt.type == MBEDTLS_PK_ECKEY) { in main()
|