/mbedtls-latest/tests/suites/ |
D | test_suite_constant_time.function | 203 size_t size = 32; 204 TEST_CALLOC(a, size); 205 TEST_CALLOC(b, size); 207 TEST_CF_SECRET(a, size); 208 TEST_CF_SECRET(b, size); 209 int result = mbedtls_ct_memcmp(a, b, size); 210 TEST_CF_PUBLIC(a, size); 211 TEST_CF_PUBLIC(b, size); 216 for (size_t offset = 0; offset < size; offset++) { 222 TEST_CF_SECRET(a, size); [all …]
|
D | test_suite_alignment.function | 31 void mbedtls_unaligned_access(int size, int offset) 42 TEST_ASSERT(size == 16 || size == 32 || size == 64); 45 switch (size) { 62 memcpy(&raw_aligned_64, ((uint8_t *) &raw) + offset, size / 8); 65 switch (size) { 80 for (size_t i = 0; i < (size_t) (size / 8); i++) { 87 switch (size) { 105 void mbedtls_byteswap(char *input_str, int size, char *expected_str) 113 switch (size) { 124 TEST_FAIL("size must be 16, 32 or 64"); [all …]
|
D | test_suite_asn1write.function | 12 size_t size; 17 mbedtls_test_set_step(data->size); 20 TEST_CALLOC(data->output, data->size == 0 ? 1 : data->size); 21 data->end = data->output + data->size; 23 data->start = data->end - data->size; 34 if (data->size < expected->len) { 62 for (data.size = 0; data.size <= expected->len + 1; data.size++) { 84 for (data.size = 0; data.size <= expected->len + 1; data.size++) { 112 for (data.size = 0; data.size <= expected->len + 1; data.size++) { 141 for (data.size = 0; data.size <= expected->len + 1; data.size++) { [all …]
|
D | test_suite_lms.function | 82 unsigned int size; 122 for (size = 0; size < sig->len; size++) { 123 if (size == sig->len) { 127 TEST_CALLOC(tmp_sig, size); 129 memcpy(tmp_sig, sig->x, MIN(size, sig->len)); 132 TEST_EQUAL(mbedtls_lms_verify(&ctx, msg->x, msg->len, tmp_sig, size),
|
D | test_suite_lmots.function | 82 unsigned int size; 120 for (size = 0; size < sig->len; size++) { 121 if (size == sig->len) { 125 TEST_CALLOC(tmp_sig, size); 127 memcpy(tmp_sig, sig->x, MIN(size, sig->len)); 130 TEST_EQUAL(mbedtls_lmots_verify(&ctx, msg->x, msg->len, tmp_sig, size),
|
D | test_suite_test_helpers.function | 19 void memory_poison_unpoison(int align, int size) 22 const size_t buffer_size = align + size; 30 mbedtls_test_memory_poison(start, (size_t) size); 31 mbedtls_test_memory_unpoison(start, (size_t) size);
|
D | test_suite_aes.function | 176 // encrypt in multiple steps of varying size 372 void aes_crypt_xts_size(int size, int retval) 378 size_t length = size; 391 void aes_crypt_xts_keysize(int size, int retval) 395 size_t key_len = size; 566 size_t size; 570 &size, out, in, out)); 598 size_t size; 624 size = 16; 626 &size, out, in, out) [all …]
|
D | test_suite_psa_crypto_entropy.function | 10 /* Calculating the minimum allowed entropy size in bytes */ 19 * \param expected_size Expected size in bytes. 23 * the entropy seed file exists and has exactly this size, 26 * the entropy seed file does not exist or has a different size, 50 TEST_EQUAL(info.size, expected_size);
|
/mbedtls-latest/tests/include/test/ |
D | memory.h | 80 void mbedtls_test_memory_poison(const unsigned char *ptr, size_t size); 81 #define MBEDTLS_TEST_MEMORY_POISON(ptr, size) \ argument 84 mbedtls_test_memory_poison(ptr, size); \ 94 void mbedtls_test_memory_unpoison(const unsigned char *ptr, size_t size); 95 #define MBEDTLS_TEST_MEMORY_UNPOISON(ptr, size) \ argument 97 mbedtls_test_memory_unpoison(ptr, size); \ 104 #define MBEDTLS_TEST_MEMORY_POISON(ptr, size) ((void) (ptr), (void) (size)) argument 105 #define MBEDTLS_TEST_MEMORY_UNPOISON(ptr, size) ((void) (ptr), (void) (size)) argument
|
/mbedtls-latest/tests/src/ |
D | test_memory.c | 40 void mbedtls_test_memory_poison(const unsigned char *ptr, size_t size) in mbedtls_test_memory_poison() argument 45 if (size == 0) { in mbedtls_test_memory_poison() 48 align_for_asan(&ptr, &size); in mbedtls_test_memory_poison() 49 __asan_poison_memory_region(ptr, size); in mbedtls_test_memory_poison() 52 void mbedtls_test_memory_unpoison(const unsigned char *ptr, size_t size) in mbedtls_test_memory_unpoison() argument 54 if (size == 0) { in mbedtls_test_memory_unpoison() 57 align_for_asan(&ptr, &size); in mbedtls_test_memory_unpoison() 58 __asan_unpoison_memory_region(ptr, size); in mbedtls_test_memory_unpoison()
|
/mbedtls-latest/library/ |
D | memory_buffer_alloc.c | 35 size_t size; member 80 hdr->alloc, hdr->size); in debug_header() 199 static void *buffer_alloc_calloc(size_t n, size_t size) in buffer_alloc_calloc() argument 214 original_len = len = n * size; in buffer_alloc_calloc() 216 if (n == 0 || size == 0 || len / n != size) { in buffer_alloc_calloc() 230 if (cur->size >= len) { in buffer_alloc_calloc() 255 if (cur->size - len < sizeof(memory_header) + in buffer_alloc_calloc() 275 heap.total_used += cur->size; in buffer_alloc_calloc() 299 new->size = cur->size - len - sizeof(memory_header); in buffer_alloc_calloc() 329 cur->size = len; in buffer_alloc_calloc() [all …]
|
D | x509write_csr.c | 136 size_t size, in x509write_csr_der_internal() argument 155 c = buf + size; in x509write_csr_der_internal() 262 c2 = buf + size; in x509write_csr_der_internal() 289 size_t size, in mbedtls_x509write_csr_der() argument 300 ret = x509write_csr_der_internal(ctx, buf, size, in mbedtls_x509write_csr_der() 313 int mbedtls_x509write_csr_pem(mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size, in mbedtls_x509write_csr_pem() argument 320 if ((ret = mbedtls_x509write_csr_der(ctx, buf, size, in mbedtls_x509write_csr_pem() 326 buf + size - ret, in mbedtls_x509write_csr_pem() 327 ret, buf, size, &olen)) != 0) { in mbedtls_x509write_csr_pem()
|
D | md.c | 637 size_t size = ctx->md_info->size; in mbedtls_md_finish() local 639 output, size, &size); in mbedtls_md_finish() 678 return mbedtls_sha3_finish(ctx->md_ctx, output, ctx->md_info->size); in mbedtls_md_finish() 694 size_t size = md_info->size; in mbedtls_md() local 697 output, size, &size); in mbedtls_md() 733 return mbedtls_sha3(MBEDTLS_SHA3_224, input, ilen, output, md_info->size); in mbedtls_md() 735 return mbedtls_sha3(MBEDTLS_SHA3_256, input, ilen, output, md_info->size); in mbedtls_md() 737 return mbedtls_sha3(MBEDTLS_SHA3_384, input, ilen, output, md_info->size); in mbedtls_md() 739 return mbedtls_sha3(MBEDTLS_SHA3_512, input, ilen, output, md_info->size); in mbedtls_md() 752 return md_info->size; in mbedtls_md_get_size() [all …]
|
D | chacha20.c | 202 size_t size, in mbedtls_chacha20_update() argument 209 while (size > 0U && ctx->keystream_bytes_used < CHACHA20_BLOCK_SIZE_BYTES) { in mbedtls_chacha20_update() 215 size--; in mbedtls_chacha20_update() 219 while (size >= CHACHA20_BLOCK_SIZE_BYTES) { in mbedtls_chacha20_update() 227 size -= CHACHA20_BLOCK_SIZE_BYTES; in mbedtls_chacha20_update() 231 if (size > 0U) { in mbedtls_chacha20_update() 236 mbedtls_xor(output + offset, input + offset, ctx->keystream8, size); in mbedtls_chacha20_update() 238 ctx->keystream_bytes_used = size; in mbedtls_chacha20_update()
|
D | x509_internal.h | 46 int mbedtls_x509_sig_alg_gets(char *buf, size_t size, const mbedtls_x509_buf *sig_oid, 60 unsigned char *sig, size_t size, 74 int mbedtls_x509_info_subject_alt_name(char **buf, size_t *size, 78 int mbedtls_x509_info_cert_type(char **buf, size_t *size, 80 int mbedtls_x509_info_key_usage(char **buf, size_t *size,
|
D | pkwrite.c | 445 int mbedtls_pk_write_pubkey_der(const mbedtls_pk_context *key, unsigned char *buf, size_t size) in mbedtls_pk_write_pubkey_der() argument 454 if (size == 0) { in mbedtls_pk_write_pubkey_der() 458 c = buf + size; in mbedtls_pk_write_pubkey_der() 512 int mbedtls_pk_write_key_der(const mbedtls_pk_context *key, unsigned char *buf, size_t size) in mbedtls_pk_write_key_der() argument 516 if (size == 0) { in mbedtls_pk_write_key_der() 520 c = buf + size; in mbedtls_pk_write_key_der() 552 int mbedtls_pk_write_pubkey_pem(const mbedtls_pk_context *key, unsigned char *buf, size_t size) in mbedtls_pk_write_pubkey_pem() argument 569 ret, buf, size, &olen)) != 0) { in mbedtls_pk_write_pubkey_pem() 579 int mbedtls_pk_write_key_pem(const mbedtls_pk_context *key, unsigned char *buf, size_t size) in mbedtls_pk_write_key_pem() argument 618 ret, buf, size, &olen)) != 0) { in mbedtls_pk_write_key_pem()
|
D | x509write_crt.c | 392 const char *t, size_t size) in x509_write_time() argument 403 size - 2)); in x509_write_time() 410 size)); in x509_write_time() 420 unsigned char *buf, size_t size, in mbedtls_x509write_crt_der() argument 444 c = buf + size; in mbedtls_x509write_crt_der() 634 c2 = buf + size; in mbedtls_x509write_crt_der() 664 unsigned char *buf, size_t size, in mbedtls_x509write_crt_pem() argument 671 if ((ret = mbedtls_x509write_crt_der(crt, buf, size, in mbedtls_x509write_crt_pem() 677 buf + size - ret, ret, in mbedtls_x509write_crt_pem() 678 buf, size, &olen)) != 0) { in mbedtls_x509write_crt_pem()
|
D | x509.c | 812 int mbedtls_x509_dn_gets(char *buf, size_t size, const mbedtls_x509_name *dn) in mbedtls_x509_dn_gets() argument 830 n = size; in mbedtls_x509_dn_gets() 938 return (int) (size - n); in mbedtls_x509_dn_gets() 945 int mbedtls_x509_serial_gets(char *buf, size_t size, const mbedtls_x509_buf *serial) in mbedtls_x509_serial_gets() argument 952 n = size; in mbedtls_x509_serial_gets() 972 return (int) (size - n); in mbedtls_x509_serial_gets() 979 int mbedtls_x509_sig_alg_gets(char *buf, size_t size, const mbedtls_x509_buf *sig_oid, in mbedtls_x509_sig_alg_gets() argument 985 size_t n = size; in mbedtls_x509_sig_alg_gets() 1017 return (int) (size - n); in mbedtls_x509_sig_alg_gets() 1511 int mbedtls_x509_info_subject_alt_name(char **buf, size_t *size, in mbedtls_x509_info_subject_alt_name() argument [all …]
|
D | psa_its_file.c | 58 uint8_t size[sizeof(uint32_t)]; member 101 p_info->size = MBEDTLS_GET_UINT32_LE(header.size, 0); in psa_its_read_file() 143 if (data_offset + data_length > info.size) { in psa_its_get() 191 MBEDTLS_PUT_UINT32_LE(data_length, header.size, 0); in psa_its_set()
|
D | oid.c | 922 int mbedtls_oid_get_numeric_string(char *buf, size_t size, in FN_OID_TYPED_FROM_ASN1() 927 size_t n = size; in FN_OID_TYPED_FROM_ASN1() 930 if (size > INT_MAX) { in FN_OID_TYPED_FROM_ASN1() 955 if (n == size) { in FN_OID_TYPED_FROM_ASN1() 987 return (int) (size - n); in FN_OID_TYPED_FROM_ASN1() 1043 const char *oid_str, size_t size) in mbedtls_oid_from_numeric_string() argument 1047 const char *str_bound = oid_str + size; in mbedtls_oid_from_numeric_string() 1055 for (size_t i = 0; i < size; i++) { in mbedtls_oid_from_numeric_string()
|
D | asn1write.c | 83 const unsigned char *buf, size_t size) in mbedtls_asn1_write_raw_buffer() argument 87 if (*p < start || (size_t) (*p - start) < size) { in mbedtls_asn1_write_raw_buffer() 91 len = size; in mbedtls_asn1_write_raw_buffer() 340 const unsigned char *buf, size_t size) in mbedtls_asn1_write_octet_string() argument 345 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_raw_buffer(p, start, buf, size)); in mbedtls_asn1_write_octet_string()
|
D | platform.c | 25 static void *platform_calloc_uninit(size_t n, size_t size) in platform_calloc_uninit() argument 28 ((void) size); in platform_calloc_uninit() 47 void *mbedtls_calloc(size_t nmemb, size_t size) in mbedtls_calloc() argument 49 return (*mbedtls_calloc_func)(nmemb, size); in mbedtls_calloc()
|
/mbedtls-latest/tests/configs/ |
D | user-config-malloc-0-null.h | 12 static inline void *custom_calloc(size_t nmemb, size_t size) in custom_calloc() argument 14 if (nmemb == 0 || size == 0) { in custom_calloc() 17 return calloc(nmemb, size); in custom_calloc()
|
/mbedtls-latest/docs/proposed/ |
D | psa-driver-interface.md | 24 …rticular combination of parameters (cryptographic algorithm, key type and size, etc.), it is used … 83 …transparent drivers, optional for opaque drivers, integer or string). The size in bytes of the [pe… 119 * or the value of the capability's `"key_sizes"` property includes the key's size. 121 …size, and all the capabilities map the entry point to the same function name, the driver is consid… 123 …ities for a given combination of entry point, algorithm, key type and key size, the first matching… 190 3. `size_t key_buffer_size`: the size of the key buffer in bytes. 198 2. `size_t key_buffer_size`: the size of the key buffer in bytes. 209 …t8_t *` and is immediately followed by a parameter of type `size_t` that indicates the buffer size. 210 …iately followed by a parameter of type `size_t` that indicates the buffer size. A third parameter … 211 …iately followed by a parameter of type `size_t` that indicates the buffer size. In-out buffers are… [all …]
|
/mbedtls-latest/include/mbedtls/ |
D | x509_csr.h | 201 int mbedtls_x509_csr_info(char *buf, size_t size, const char *prefix, 351 int mbedtls_x509write_csr_der(mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size, 370 int mbedtls_x509write_csr_pem(mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size,
|