/mbedtls-latest/library/ |
D | lms.c | 66 #define MERKLE_TREE_NODE_AM(type) ((size_t) 1 << (MBEDTLS_LMS_H_TREE_HEIGHT(type) + 1u)) argument 67 #define MERKLE_TREE_LEAF_NODE_AM(type) ((size_t) 1 << MBEDTLS_LMS_H_TREE_HEIGHT(type)) argument 68 #define MERKLE_TREE_INTERNAL_NODE_AM(type) ((unsigned int) \ argument 69 (1u << MBEDTLS_LMS_H_TREE_HEIGHT(type))) 133 status = psa_hash_finish(&op, out, MBEDTLS_LMS_M_NODE_BYTES(params->type), in create_merkle_leaf_value() 202 MBEDTLS_LMS_M_NODE_BYTES(params->type)); in create_merkle_internal_value() 208 MBEDTLS_LMS_M_NODE_BYTES(params->type)); in create_merkle_internal_value() 213 status = psa_hash_finish(&op, out, MBEDTLS_LMS_M_NODE_BYTES(params->type), in create_merkle_internal_value() 242 mbedtls_lms_algorithm_type_t type; in mbedtls_lms_import_public_key() local 245 type = (mbedtls_lms_algorithm_type_t) MBEDTLS_GET_UINT32_BE(key, PUBLIC_KEY_TYPE_OFFSET); in mbedtls_lms_import_public_key() [all …]
|
D | lmots.c | 89 for (idx = 0; idx < MBEDTLS_LMOTS_N_HASH_LEN(params->type); idx++) { in lmots_checksum_calculate() 153 MBEDTLS_LMOTS_C_RANDOM_VALUE_LEN(params->type)); in create_digit_array_with_checksum() 164 MBEDTLS_LMOTS_N_HASH_LEN(params->type), in create_digit_array_with_checksum() 171 MBEDTLS_PUT_UINT16_BE(checksum, out, MBEDTLS_LMOTS_N_HASH_LEN(params->type)); in create_digit_array_with_checksum() 226 i_digit_idx < MBEDTLS_LMOTS_P_SIG_DIGIT_COUNT(params->type); in hash_digit_array() 230 &x_digit_array[i_digit_idx * MBEDTLS_LMOTS_N_HASH_LEN(params->type)], in hash_digit_array() 231 MBEDTLS_LMOTS_N_HASH_LEN(params->type)); in hash_digit_array() 273 MBEDTLS_LMOTS_N_HASH_LEN(params->type)); in hash_digit_array() 287 memcpy(&output[i_digit_idx * MBEDTLS_LMOTS_N_HASH_LEN(params->type)], in hash_digit_array() 288 tmp_hash, MBEDTLS_LMOTS_N_HASH_LEN(params->type)); in hash_digit_array() [all …]
|
D | psa_crypto_ecp.c | 91 psa_key_type_t type, size_t curve_bits, in mbedtls_psa_ecp_load_representation() argument 101 if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type) && in mbedtls_psa_ecp_load_representation() 102 PSA_KEY_TYPE_ECC_GET_FAMILY(type) != PSA_ECC_FAMILY_MONTGOMERY) { in mbedtls_psa_ecp_load_representation() 140 status = check_ecc_parameters(PSA_KEY_TYPE_ECC_GET_FAMILY(type), &curve_bits); in mbedtls_psa_ecp_load_representation() 146 grp_id = mbedtls_ecc_group_from_psa(PSA_KEY_TYPE_ECC_GET_FAMILY(type), in mbedtls_psa_ecp_load_representation() 160 if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type)) { in mbedtls_psa_ecp_load_representation() 219 status = mbedtls_psa_ecp_load_representation(attributes->type, 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() 251 psa_status_t mbedtls_psa_ecp_export_key(psa_key_type_t type, in mbedtls_psa_ecp_export_key() argument [all …]
|
D | pk_wrap.c | 52 static int rsa_can_do(mbedtls_pk_type_t type) in rsa_can_do() argument 54 return type == MBEDTLS_PK_RSA || in rsa_can_do() 55 type == MBEDTLS_PK_RSASSA_PSS; in rsa_can_do() 480 items->type = MBEDTLS_PK_DEBUG_MPI; in rsa_debug() 486 items->type = MBEDTLS_PK_DEBUG_MPI; in rsa_debug() 493 .type = MBEDTLS_PK_RSA, 518 static int eckey_can_do(mbedtls_pk_type_t type) in eckey_can_do() argument 520 return type == MBEDTLS_PK_ECKEY || in eckey_can_do() 521 type == MBEDTLS_PK_ECKEY_DH || in eckey_can_do() 522 type == MBEDTLS_PK_ECDSA; in eckey_can_do() [all …]
|
D | psa_crypto_rsa.c | 60 psa_key_type_t type, const uint8_t *data, size_t data_length, in mbedtls_psa_rsa_load_representation() argument 73 if (PSA_KEY_TYPE_IS_KEY_PAIR(type)) { in mbedtls_psa_rsa_load_representation() 119 status = mbedtls_psa_rsa_load_representation(attributes->type, in mbedtls_psa_rsa_import_key() 133 status = mbedtls_psa_rsa_export_key(attributes->type, in mbedtls_psa_rsa_import_key() 151 psa_status_t mbedtls_psa_rsa_export_key(psa_key_type_t type, in mbedtls_psa_rsa_export_key() argument 163 if (PSA_KEY_TYPE_IS_KEY_PAIR(type)) { in mbedtls_psa_rsa_export_key() 199 attributes->type, key_buffer, key_buffer_size, &rsa); in mbedtls_psa_rsa_export_public_key() 269 status = mbedtls_psa_rsa_export_key(attributes->type, in mbedtls_psa_rsa_generate_key() 327 status = mbedtls_psa_rsa_load_representation(attributes->type, in mbedtls_psa_rsa_sign_hash() 426 status = mbedtls_psa_rsa_load_representation(attributes->type, in mbedtls_psa_rsa_verify_hash() [all …]
|
D | md.c | 68 #define MD_INFO(type, out_size, block_size) type, out_size, block_size, argument 70 #define MD_INFO(type, out_size, block_size) type, out_size, argument 194 switch (info->type) { in psa_alg_of_md() 273 switch (ctx->md_info->type) { in mbedtls_md_free() 358 switch (src->md_info->type) { in mbedtls_md_clone() 409 #define ALLOC(type) \ argument 411 ctx->md_ctx = mbedtls_calloc(1, sizeof(mbedtls_##type##_context)); \ 414 mbedtls_##type##_init(ctx->md_ctx); \ 448 switch (md_info->type) { in mbedtls_md_setup() 527 switch (ctx->md_info->type) { in mbedtls_md_starts() [all …]
|
D | pk.c | 72 if ((ctx->pk_info != NULL) && (ctx->pk_info->type != MBEDTLS_PK_OPAQUE)) { in mbedtls_pk_free() 161 psa_key_type_t type; in mbedtls_pk_setup_opaque() local 170 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() 178 if (type == PSA_KEY_TYPE_RSA_KEY_PAIR) { in mbedtls_pk_setup_opaque() 227 int mbedtls_pk_can_do(const mbedtls_pk_context *ctx, mbedtls_pk_type_t type) in mbedtls_pk_can_do() argument 236 return ctx->pk_info->can_do(type); in mbedtls_pk_can_do() 279 mbedtls_pk_type_t type; in mbedtls_pk_can_do_ext() local 282 type = MBEDTLS_PK_ECKEY; in mbedtls_pk_can_do_ext() 285 type = MBEDTLS_PK_RSA; in mbedtls_pk_can_do_ext() [all …]
|
D | lmots.h | 27 #define MBEDTLS_LMOTS_PUBLIC_KEY_LEN(type) (MBEDTLS_LMOTS_TYPE_LEN + \ argument 30 MBEDTLS_LMOTS_N_HASH_LEN(type)) 35 #define MBEDTLS_LMOTS_SIG_SIGNATURE_OFFSET(type) (MBEDTLS_LMOTS_SIG_C_RANDOM_OFFSET + \ argument 36 MBEDTLS_LMOTS_C_RANDOM_VALUE_LEN(type)) 226 mbedtls_lmots_algorithm_type_t type,
|
D | psa_crypto.c | 90 static int key_type_is_raw_bytes(psa_key_type_t type) in key_type_is_raw_bytes() argument 92 return PSA_KEY_TYPE_IS_UNSTRUCTURED(type); in key_type_is_raw_bytes() 614 psa_status_t psa_validate_unstructured_key_bit_size(psa_key_type_t type, in psa_validate_unstructured_key_bit_size() argument 618 switch (type) { in psa_validate_unstructured_key_bit_size() 753 psa_key_type_t type = attributes->type; in psa_import_key_into_slot() local 760 if (key_type_is_raw_bytes(type)) { in psa_import_key_into_slot() 763 status = psa_validate_unstructured_key_bit_size(attributes->type, in psa_import_key_into_slot() 775 } else if (PSA_KEY_TYPE_IS_ASYMMETRIC(type)) { in psa_import_key_into_slot() 778 if (PSA_KEY_TYPE_IS_DH(type)) { in psa_import_key_into_slot() 792 if (PSA_KEY_TYPE_IS_ECC(type)) { in psa_import_key_into_slot() [all …]
|
D | psa_crypto_storage.h | 283 psa_crypto_transaction_type_t type; member 292 psa_crypto_transaction_type_t type; member 311 psa_crypto_transaction_type_t type) in psa_crypto_prepare_transaction() argument 313 psa_crypto_transaction.unknown.type = type; in psa_crypto_prepare_transaction()
|
D | cipher.c | 67 int *type; in mbedtls_cipher_list() local 71 type = mbedtls_cipher_supported; in mbedtls_cipher_list() 73 while (def->type != 0) { in mbedtls_cipher_list() 74 *type++ = (*def++).type; in mbedtls_cipher_list() 77 *type = 0; in mbedtls_cipher_list() 91 if (def->type == cipher_type) { in mbedtls_cipher_info_from_type() 284 if (mbedtls_psa_translate_cipher_type(((mbedtls_cipher_type_t) cipher_info->type)) == 0) { in mbedtls_cipher_setup_psa() 342 ((mbedtls_cipher_type_t) ctx->cipher_info->type)); in mbedtls_cipher_setkey() 447 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20) { in mbedtls_cipher_set_iv() 462 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20_POLY1305 && in mbedtls_cipher_set_iv() [all …]
|
/mbedtls-latest/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 static 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 …]
|
D | test_suite_psa_crypto_metadata.data | 356 Key type: raw data 359 Key type: HMAC 363 Key type: secret for key derivation 366 Key type: password 369 Key type: password hash 372 Block cipher key type: AES 376 Block cipher key type: ARIA 380 Block cipher key type: DES 384 Block cipher key type: Camellia 388 Stream cipher key type: ChaCha20 [all …]
|
/mbedtls-latest/include/mbedtls/ |
D | lms.h | 33 #define MBEDTLS_LMOTS_N_HASH_LEN(type) ((type) == MBEDTLS_LMOTS_SHA256_N32_W8 ? 32u : 0) argument 37 #define MBEDTLS_LMOTS_P_SIG_DIGIT_COUNT(type) ((type) == MBEDTLS_LMOTS_SHA256_N32_W8 ? 34u : 0) argument 38 #define MBEDTLS_LMOTS_C_RANDOM_VALUE_LEN(type) (MBEDTLS_LMOTS_N_HASH_LEN(type)) argument 40 #define MBEDTLS_LMOTS_SIG_LEN(type) (MBEDTLS_LMOTS_TYPE_LEN + \ argument 41 MBEDTLS_LMOTS_C_RANDOM_VALUE_LEN(type) + \ 42 (MBEDTLS_LMOTS_P_SIG_DIGIT_COUNT(type) * \ 43 MBEDTLS_LMOTS_N_HASH_LEN(type))) 47 #define MBEDTLS_LMS_H_TREE_HEIGHT(type) ((type) == MBEDTLS_LMS_SHA256_M32_H10 ? 10u : 0) argument 52 #define MBEDTLS_LMS_M_NODE_BYTES(type) ((type) == MBEDTLS_LMS_SHA256_M32_H10 ? 32 : 0) argument 55 #define MBEDTLS_LMS_SIG_LEN(type, otstype) (MBEDTLS_LMOTS_Q_LEAF_ID_LEN + \ argument [all …]
|
/mbedtls-latest/include/psa/ |
D | crypto_values.h | 379 #define PSA_KEY_TYPE_IS_VENDOR_DEFINED(type) \ argument 380 (((type) & PSA_KEY_TYPE_VENDOR_FLAG) != 0) 386 #define PSA_KEY_TYPE_IS_UNSTRUCTURED(type) \ argument 387 (((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_RAW || \ 388 ((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_SYMMETRIC) 391 #define PSA_KEY_TYPE_IS_ASYMMETRIC(type) \ argument 392 (((type) & PSA_KEY_TYPE_CATEGORY_MASK \ 396 #define PSA_KEY_TYPE_IS_PUBLIC_KEY(type) \ argument 397 (((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY) 400 #define PSA_KEY_TYPE_IS_KEY_PAIR(type) \ argument [all …]
|
/mbedtls-latest/programs/test/ |
D | udp_proxy.c | 480 const char *type; member 491 elapsed_time(), p->way, p->type, p->len); in print_packet() 494 elapsed_time(), p->way, p->type, p->len, why); in print_packet() 499 p->way, p->type, p->len); in print_packet() 502 p->way, p->type, p->len, why); in print_packet() 538 strcmp(p->type, "ClientHello") == 0) { in send_packet() 545 strcmp(p->type, "CID") == 0 && in send_packet() 562 strcmp(p->type, "ApplicationData") == 0) { in send_packet() 587 strcmp(p->type, "ApplicationData") != 0 && in send_packet() 600 strcmp(p->type, "ApplicationData") == 0) { in send_packet() [all …]
|
/mbedtls-latest/tests/src/ |
D | psa_exercise_key.c | 48 psa_key_type_t type; in check_key_attributes_sanity() local 59 type = psa_get_key_type(&attributes); in check_key_attributes_sanity() 93 TEST_ASSERT(type != 0); in check_key_attributes_sanity() 96 if (PSA_KEY_TYPE_IS_UNSTRUCTURED(type)) { in check_key_attributes_sanity() 101 if (PSA_KEY_TYPE_IS_ECC(type)) { in check_key_attributes_sanity() 103 } else if (PSA_KEY_TYPE_IS_RSA(type)) { in check_key_attributes_sanity() 106 TEST_ASSERT(PSA_BLOCK_CIPHER_BLOCK_LENGTH(type) <= PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE); in check_key_attributes_sanity() 844 psa_key_type_t type, size_t bits, in mbedtls_test_psa_exported_key_sanity_check() argument 847 TEST_ASSERT(exported_length <= PSA_EXPORT_KEY_OUTPUT_SIZE(type, bits)); in mbedtls_test_psa_exported_key_sanity_check() 849 if (PSA_KEY_TYPE_IS_UNSTRUCTURED(type)) { in mbedtls_test_psa_exported_key_sanity_check() [all …]
|
/mbedtls-latest/tests/scripts/ |
D | generate_server9_bad_saltlen.py | 34 parser.add_argument('--ca-name', type=str, required=True, 36 parser.add_argument('--ca-password', type=str, 38 parser.add_argument('--csr', type=str, required=True, 40 parser.add_argument('--openssl-extfile', type=str, 42 parser.add_argument('--anounce_saltlen', type=auto_int, 44 parser.add_argument('--actual_saltlen', type=auto_int, 46 parser.add_argument('--output', type=str, required=True)
|
/mbedtls-latest/programs/cipher/ |
D | cipher_aead_demo.c | 121 mbedtls_cipher_type_t type; in aead_prepare() local 123 type = MBEDTLS_CIPHER_AES_128_GCM; in aead_prepare() 126 type = MBEDTLS_CIPHER_AES_256_GCM; in aead_prepare() 129 type = MBEDTLS_CIPHER_AES_128_GCM; in aead_prepare() 132 type = MBEDTLS_CIPHER_CHACHA20_POLY1305; in aead_prepare() 141 mbedtls_cipher_info_from_type(type))); in aead_prepare() 159 mbedtls_cipher_type_t type = mbedtls_cipher_get_type(ctx); in aead_info() local 160 const mbedtls_cipher_info_t *info = mbedtls_cipher_info_from_type(type); in aead_info()
|
/mbedtls-latest/tests/src/drivers/ |
D | test_driver_key_management.c | 274 psa_key_type_t type = psa_get_key_type(attributes); in mbedtls_test_transparent_import_key() local 283 if (PSA_KEY_TYPE_IS_ECC(type)) { in mbedtls_test_transparent_import_key() 300 } else if (PSA_KEY_TYPE_IS_RSA(type)) { in mbedtls_test_transparent_import_key() 317 } else if (PSA_KEY_TYPE_IS_DH(type)) { in mbedtls_test_transparent_import_key() 341 (void) type; in mbedtls_test_transparent_import_key() 357 psa_key_type_t type = psa_get_key_type(attributes); in mbedtls_test_opaque_import_key() local 374 if (PSA_KEY_TYPE_IS_UNSTRUCTURED(type)) { in mbedtls_test_opaque_import_key() 377 status = psa_validate_unstructured_key_bit_size(type, in mbedtls_test_opaque_import_key() 390 } else if (PSA_KEY_TYPE_IS_ECC(type)) { in mbedtls_test_opaque_import_key() 412 } else if (PSA_KEY_TYPE_IS_RSA(type)) { in mbedtls_test_opaque_import_key() [all …]
|
/mbedtls-latest/programs/x509/ |
D | cert_req.c | 259 cur->node.type = MBEDTLS_X509_SAN_RFC822_NAME; in main() 261 cur->node.type = MBEDTLS_X509_SAN_UNIFORM_RESOURCE_IDENTIFIER; in main() 263 cur->node.type = MBEDTLS_X509_SAN_DNS_NAME; in main() 266 cur->node.type = MBEDTLS_X509_SAN_IP_ADDRESS; in main() 276 cur->node.type = MBEDTLS_X509_SAN_DIRECTORY_NAME; in main() 292 if (cur->node.type == MBEDTLS_X509_SAN_RFC822_NAME || in main() 293 cur->node.type == MBEDTLS_X509_SAN_UNIFORM_RESOURCE_IDENTIFIER || in main() 294 cur->node.type == MBEDTLS_X509_SAN_DNS_NAME) { in main()
|