/mbedtls-latest/tests/suites/ |
D | test_suite_psa_crypto_low_hash.function | 30 uint8_t *output = NULL; 35 ASSERT_ALLOC(output, output_size); 37 output, output_size, &length), 39 ASSERT_COMPARE(expected->x, expected->len, output, length); 40 mbedtls_free(output); 41 output = NULL; 43 /* Larger output buffer */ 45 ASSERT_ALLOC(output, output_size); 47 output, output_size, &length), 49 ASSERT_COMPARE(expected->x, expected->len, output, length); [all …]
|
D | test_suite_aria.function | 24 unsigned char output[MBEDTLS_ARIA_BLOCKSIZE] = { 0 }; 32 ((void) output); 41 output)); 52 output)); 67 unsigned char output[ARIA_MAX_DATASIZE]; 71 memset(output, 0x00, sizeof(output)); 79 output + i) == 0); 82 TEST_MEMORY_COMPARE(output, expected_output->len, 95 unsigned char output[ARIA_MAX_DATASIZE]; 99 memset(output, 0x00, sizeof(output)); [all …]
|
D | test_suite_shax.function | 11 unsigned char output[41]; 13 memset(output, 0x00, 41); 16 TEST_ASSERT(mbedtls_sha1(src_str->x, src_str->len, output) == 0); 18 TEST_ASSERT(mbedtls_test_hexcmp(output, hash->x, 20, hash->len) == 0); 45 unsigned char output[57]; 47 memset(output, 0x00, 57); 50 TEST_EQUAL(mbedtls_sha256(src_str->x, src_str->len, output, 1), 0); 52 TEST_EQUAL(mbedtls_test_hexcmp(output, hash->x, 28, hash->len), 0); 59 unsigned char output[65]; 61 memset(output, 0x00, 65); [all …]
|
D | test_suite_des.function | 20 unsigned char output[100]; 23 memset(output, 0x00, 100); 28 TEST_ASSERT(mbedtls_des_crypt_ecb(&ctx, src_str->x, output) == 0); 30 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, 8, dst->len) == 0); 40 unsigned char output[100]; 43 memset(output, 0x00, 100); 48 TEST_ASSERT(mbedtls_des_crypt_ecb(&ctx, src_str->x, output) == 0); 50 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, 8, dst->len) == 0); 61 unsigned char output[100]; 64 memset(output, 0x00, 100); [all …]
|
D | test_suite_aes.function | 20 unsigned char output[16]; 41 plaintext, output) == 0); 42 TEST_MEMORY_COMPARE(ciphertext, 16, output, 16); 47 ciphertext, output) == 0); 48 TEST_MEMORY_COMPARE(plaintext, 16, output, 16); 72 unsigned char output[100]; 75 memset(output, 0x00, 100); 81 TEST_ASSERT(mbedtls_aes_crypt_ecb(&ctx, MBEDTLS_AES_ENCRYPT, src_str->x, output) == 0); 83 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, 16, dst->len) == 0); 94 unsigned char *output = NULL; [all …]
|
D | test_suite_platform_printf.function | 31 char *output = NULL; 35 TEST_CALLOC(output, n + 1); 36 TEST_EQUAL(n, mbedtls_snprintf(output, n + 1, format, x)); 37 TEST_MEMORY_COMPARE(result, n + 1, output, n + 1); 38 mbedtls_free(output); 39 output = NULL; 42 mbedtls_free(output); 51 char *output = NULL; 60 TEST_CALLOC(output, n + 1); 61 TEST_EQUAL(n, mbedtls_snprintf(output, n + 1, format, value)); [all …]
|
D | test_suite_ccm.function | 5 * and check that the output matches the expected output. 18 uint8_t *output = NULL; 35 TEST_CALLOC(output, n1); 37 TEST_EQUAL(0, mbedtls_ccm_update(ctx, input->x, n1, output, n1, &olen)); 39 TEST_MEMORY_COMPARE(output, olen, expected_output->x, n1); 40 mbedtls_free(output); 41 output = NULL; 43 TEST_CALLOC(output, n2); 45 TEST_EQUAL(0, mbedtls_ccm_update(ctx, input->x + n1, n2, output, n2, &olen)); 47 TEST_MEMORY_COMPARE(output, olen, expected_output->x + n1, n2); [all …]
|
D | test_suite_camellia.function | 50 unsigned char output[100]; 53 memset(output, 0x00, 100); 60 output) == 0); 62 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, 16, dst->len) == 0); 74 unsigned char output[100]; 77 memset(output, 0x00, 100); 84 output) == 0); 86 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, 16, dst->len) == 0); 98 unsigned char output[100]; 101 memset(output, 0x00, 100); [all …]
|
D | test_suite_gcm.function | 5 * and check that the output matches the expected output. 18 uint8_t *output = NULL; 36 TEST_CALLOC(output, n1); 38 TEST_EQUAL(0, mbedtls_gcm_update(ctx, input->x, n1, output, n1, &olen)); 40 TEST_MEMORY_COMPARE(output, olen, expected_output->x, n1); 41 mbedtls_free(output); 42 output = NULL; 44 TEST_CALLOC(output, n2); 46 TEST_EQUAL(0, mbedtls_gcm_update(ctx, input->x + n1, n2, output, n2, &olen)); 48 TEST_MEMORY_COMPARE(output, olen, expected_output->x + n1, n2); [all …]
|
D | test_suite_psa_crypto_op_fail.function | 51 uint8_t output[PSA_HASH_MAX_SIZE] = { 0 }; 60 output, sizeof(output), &length)); 63 output, sizeof(output))); 82 uint8_t output[PSA_MAC_MAX_SIZE] = { 0 }; 103 output, sizeof(output), &length)); 107 output, sizeof(output))); 128 uint8_t output[64] = { 0 }; 149 output, sizeof(output), &length)); 153 output, sizeof(output), &length)); 174 uint8_t output[64] = { 0 }; [all …]
|
D | test_suite_psa_crypto_memory.function | 161 uint8_t *output = NULL; 167 TEST_CALLOC(output, output_len); 169 status = psa_crypto_local_output_alloc(output, output_len, &local_output); 173 TEST_ASSERT(local_output.original == output); 182 mbedtls_free(output); 183 output = NULL; 191 uint8_t *output = NULL; 197 TEST_CALLOC(output, output_len); 202 local_output.original = output; 213 MBEDTLS_TEST_MEMORY_UNPOISON(output, output_len); [all …]
|
D | test_suite_chacha20.function | 17 unsigned char output[375]; 20 memset(output, 0x00, sizeof(output)); 30 output) == 0); 32 TEST_MEMORY_COMPARE(output, expected_output_str->len, 44 memset(output, 0x00, sizeof(output)); 45 TEST_ASSERT(mbedtls_chacha20_update(&ctx, src_str->len, src_str->x, output) == 0); 47 TEST_MEMORY_COMPARE(output, expected_output_str->len, 58 memset(output, 0x00, sizeof(output)); 59 TEST_ASSERT(mbedtls_chacha20_update(&ctx, 1, src_str->x, output) == 0); 61 src_str->x + 1, output + 1) == 0); [all …]
|
D | test_suite_md.function | 199 unsigned char output[MBEDTLS_MD_MAX_SIZE] = { 0 }; 207 TEST_EQUAL(0, mbedtls_md(md_info, src, src_len, output)); 209 TEST_MEMORY_COMPARE(output, mbedtls_md_get_size(md_info), hash->x, hash->len); 219 unsigned char output[MBEDTLS_MD_MAX_SIZE] = { 0 }; 227 TEST_EQUAL(0, mbedtls_md(md_info, src_str->x, src_str->len, output)); 230 TEST_MEMORY_COMPARE(output, mbedtls_md_get_size(md_info), hash->x, hash->len); 243 unsigned char output[MBEDTLS_MD_MAX_SIZE] = { 0 }; 271 TEST_EQUAL(0, mbedtls_md_finish(&ctx, output)); 272 TEST_MEMORY_COMPARE(output, mbedtls_md_get_size(md_info), hash->x, hash->len); 275 memset(output, 0x00, sizeof(output)); [all …]
|
D | test_suite_mdx.function | 11 unsigned char output[16]; 14 memset(output, 0x00, sizeof(output)); 18 ret = mbedtls_md5(src_str, strlen((char *) src_str), output); 21 TEST_ASSERT(mbedtls_test_hexcmp(output, hash->x, 22 sizeof(output), hash->len) == 0); 31 unsigned char output[20]; 34 memset(output, 0x00, sizeof(output)); 38 ret = mbedtls_ripemd160(src_str, strlen((char *) src_str), output); 41 TEST_ASSERT(mbedtls_test_hexcmp(output, hash->x, 42 sizeof(output), hash->len) == 0);
|
D | test_suite_psa_crypto_memory.data | 16 PSA output buffer copy: straightforward copy 19 PSA output buffer copy: output buffer larger than required 22 PSA output buffer copy: output buffer too small 25 PSA output buffer copy: zero-length source buffer 28 PSA output buffer copy: zero-length both buffers 46 PSA crypto local output alloc 49 PSA crypto local output alloc, NULL buffer 52 PSA crypto local output free 55 PSA crypto local output free, NULL buffer 58 PSA crypto local output free, NULL original buffer [all …]
|
D | test_suite_chachapoly.function | 18 unsigned char output[265]; 33 input_str->x, output, mac) == 0); 35 TEST_ASSERT(memcmp(output_str->x, output, output_str->len) == 0); 52 unsigned char output[265]; 67 mac_str->x, input_str->x, output); 71 TEST_ASSERT(memcmp(output_str->x, output, output_str->len) == 0); 86 unsigned char output[1]; 96 memset(output, 0x00, sizeof(output)); 104 TEST_ASSERT(mbedtls_chachapoly_update(&ctx, input_len, input, output) 115 TEST_ASSERT(mbedtls_chachapoly_update(&ctx, input_len, input, output) [all …]
|
/mbedtls-latest/3rdparty/everest/library/ |
D | Hacl_Curve25519.c | 41 inline static void Hacl_Bignum_Fproduct_copy_from_wide_(uint64_t *output, uint128_t *input) in Hacl_Bignum_Fproduct_copy_from_wide_() argument 47 output[i] = (uint64_t)xi; in Hacl_Bignum_Fproduct_copy_from_wide_() 52 Hacl_Bignum_Fproduct_sum_scalar_multiplication_(uint128_t *output, uint64_t *input, uint64_t s) in Hacl_Bignum_Fproduct_sum_scalar_multiplication_() argument 57 uint128_t xi = output[i]; in Hacl_Bignum_Fproduct_sum_scalar_multiplication_() 59 output[i] = xi + (uint128_t)yi * s; in Hacl_Bignum_Fproduct_sum_scalar_multiplication_() 78 inline static void Hacl_Bignum_Fmul_shift_reduce(uint64_t *output) in Hacl_Bignum_Fmul_shift_reduce() argument 80 uint64_t tmp = output[4U]; in Hacl_Bignum_Fmul_shift_reduce() 87 uint64_t z = output[ctr - (uint32_t)1U]; in Hacl_Bignum_Fmul_shift_reduce() 88 output[ctr] = z; in Hacl_Bignum_Fmul_shift_reduce() 91 output[0U] = tmp; in Hacl_Bignum_Fmul_shift_reduce() [all …]
|
/mbedtls-latest/3rdparty/everest/library/legacy/ |
D | Hacl_Curve25519.c | 45 Hacl_Bignum_Fproduct_copy_from_wide_(uint64_t *output, FStar_UInt128_uint128 *input) in Hacl_Bignum_Fproduct_copy_from_wide_() argument 51 output[i] = FStar_UInt128_uint128_to_uint64(xi); in Hacl_Bignum_Fproduct_copy_from_wide_() 57 FStar_UInt128_uint128 *output, in Hacl_Bignum_Fproduct_sum_scalar_multiplication_() argument 65 FStar_UInt128_uint128 xi = output[i]; in Hacl_Bignum_Fproduct_sum_scalar_multiplication_() 67 output[i] = FStar_UInt128_add_mod(xi, FStar_UInt128_mul_wide(yi, s)); in Hacl_Bignum_Fproduct_sum_scalar_multiplication_() 86 inline static void Hacl_Bignum_Fmul_shift_reduce(uint64_t *output) in Hacl_Bignum_Fmul_shift_reduce() argument 88 uint64_t tmp = output[4U]; in Hacl_Bignum_Fmul_shift_reduce() 95 uint64_t z = output[ctr - (uint32_t)1U]; in Hacl_Bignum_Fmul_shift_reduce() 96 output[ctr] = z; in Hacl_Bignum_Fmul_shift_reduce() 99 output[0U] = tmp; in Hacl_Bignum_Fmul_shift_reduce() [all …]
|
/mbedtls-latest/tests/src/drivers/ |
D | test_driver_cipher.c | 39 uint8_t *output, in mbedtls_test_transparent_cipher_encrypt() argument 51 memcpy(output, in mbedtls_test_transparent_cipher_encrypt() 72 output, output_size, output_length); in mbedtls_test_transparent_cipher_encrypt() 77 output, output_size, output_length); in mbedtls_test_transparent_cipher_encrypt() 90 uint8_t *output, in mbedtls_test_transparent_cipher_decrypt() argument 101 memcpy(output, in mbedtls_test_transparent_cipher_decrypt() 119 output, output_size, output_length); in mbedtls_test_transparent_cipher_decrypt() 124 output, output_size, output_length); in mbedtls_test_transparent_cipher_decrypt() 239 uint8_t *output, in mbedtls_test_transparent_cipher_update() argument 250 memcpy(output, in mbedtls_test_transparent_cipher_update() [all …]
|
D | test_driver_asymmetric_encryption.c | 32 uint8_t *output, size_t output_size, size_t *output_length) in mbedtls_test_transparent_asymmetric_encrypt() argument 41 memcpy(output, in mbedtls_test_transparent_asymmetric_encrypt() 58 output, output_size, output_length); in mbedtls_test_transparent_asymmetric_encrypt() 63 output, output_size, output_length); in mbedtls_test_transparent_asymmetric_encrypt() 73 uint8_t *output, size_t output_size, size_t *output_length) in mbedtls_test_transparent_asymmetric_decrypt() argument 82 memcpy(output, in mbedtls_test_transparent_asymmetric_decrypt() 99 output, output_size, output_length); in mbedtls_test_transparent_asymmetric_decrypt() 104 output, output_size, output_length); in mbedtls_test_transparent_asymmetric_decrypt() 117 uint8_t *output, size_t output_size, size_t *output_length) in mbedtls_test_opaque_asymmetric_encrypt() argument 136 output, output_size, output_length); in mbedtls_test_opaque_asymmetric_encrypt() [all …]
|
/mbedtls-latest/library/ |
D | nist_kw.c | 132 unsigned char *output, size_t *out_len, size_t out_size) in mbedtls_nist_kw_wrap() argument 163 memcpy(output, NIST_KW_ICV1, KW_SEMIBLOCK_LENGTH); in mbedtls_nist_kw_wrap() 164 memmove(output + KW_SEMIBLOCK_LENGTH, input, in_len); in mbedtls_nist_kw_wrap() 186 memcpy(output, NIST_KW_ICV2, KW_SEMIBLOCK_LENGTH / 2); in mbedtls_nist_kw_wrap() 187 MBEDTLS_PUT_UINT32_BE((in_len & 0xffffffff), output, in mbedtls_nist_kw_wrap() 190 memcpy(output + KW_SEMIBLOCK_LENGTH, input, in_len); in mbedtls_nist_kw_wrap() 191 memset(output + KW_SEMIBLOCK_LENGTH + in_len, 0, padlen); in mbedtls_nist_kw_wrap() 199 memcpy(inbuff, output, 16); in mbedtls_nist_kw_wrap() 201 inbuff, 16, output, &olen); in mbedtls_nist_kw_wrap() 206 unsigned char *R2 = output + KW_SEMIBLOCK_LENGTH; in mbedtls_nist_kw_wrap() [all …]
|
D | cipher.c | 580 size_t ilen, unsigned char *output, size_t *olen) in mbedtls_cipher_update() argument 613 output))) { in mbedtls_cipher_update() 624 output, ilen, olen); in mbedtls_cipher_update() 632 output, ilen, olen); in mbedtls_cipher_update() 640 ilen, input, output); in mbedtls_cipher_update() 644 if (input == output && in mbedtls_cipher_update() 683 output))) { in mbedtls_cipher_update() 688 output += block_size; in mbedtls_cipher_update() 725 output))) { in mbedtls_cipher_update() 742 input, output))) { in mbedtls_cipher_update() [all …]
|
D | des.c | 596 unsigned char output[8]) in mbedtls_des_crypt_ecb() 615 MBEDTLS_PUT_UINT32_BE(Y, output, 0); in mbedtls_des_crypt_ecb() 616 MBEDTLS_PUT_UINT32_BE(X, output, 4); in mbedtls_des_crypt_ecb() 631 unsigned char *output) in mbedtls_des_crypt_cbc() argument 642 mbedtls_xor(output, input, iv, 8); in mbedtls_des_crypt_cbc() 644 ret = mbedtls_des_crypt_ecb(ctx, output, output); in mbedtls_des_crypt_cbc() 648 memcpy(iv, output, 8); in mbedtls_des_crypt_cbc() 651 output += 8; in mbedtls_des_crypt_cbc() 657 ret = mbedtls_des_crypt_ecb(ctx, input, output); in mbedtls_des_crypt_cbc() 662 mbedtls_xor(output, output, iv, 8); in mbedtls_des_crypt_cbc() [all …]
|
D | md.c | 627 int mbedtls_md_finish(mbedtls_md_context_t *ctx, unsigned char *output) in mbedtls_md_finish() argument 639 output, size, &size); in mbedtls_md_finish() 647 return mbedtls_md5_finish(ctx->md_ctx, output); in mbedtls_md_finish() 651 return mbedtls_ripemd160_finish(ctx->md_ctx, output); in mbedtls_md_finish() 655 return mbedtls_sha1_finish(ctx->md_ctx, output); in mbedtls_md_finish() 659 return mbedtls_sha256_finish(ctx->md_ctx, output); in mbedtls_md_finish() 663 return mbedtls_sha256_finish(ctx->md_ctx, output); in mbedtls_md_finish() 667 return mbedtls_sha512_finish(ctx->md_ctx, output); in mbedtls_md_finish() 671 return mbedtls_sha512_finish(ctx->md_ctx, output); in mbedtls_md_finish() 678 return mbedtls_sha3_finish(ctx->md_ctx, output, ctx->md_info->size); in mbedtls_md_finish() [all …]
|
/mbedtls-latest/tests/src/ |
D | random.c | 30 unsigned char *output, in mbedtls_test_rnd_std_rand() argument 41 output[i] = rand(); in mbedtls_test_rnd_std_rand() 48 arc4random_buf(output, len); in mbedtls_test_rnd_std_rand() 55 unsigned char *output, in mbedtls_test_rnd_zero_rand() argument 62 memset(output, 0, len); in mbedtls_test_rnd_zero_rand() 68 unsigned char *output, in mbedtls_test_rnd_buffer_rand() argument 75 return mbedtls_test_rnd_std_rand(NULL, output, len); in mbedtls_test_rnd_buffer_rand() 84 memcpy(output, info->buf, use_len); in mbedtls_test_rnd_buffer_rand() 92 output + use_len, in mbedtls_test_rnd_buffer_rand() 103 unsigned char *output, in mbedtls_test_rnd_pseudo_rand() argument [all …]
|