Home
last modified time | relevance | path

Searched refs:expected (Results 1 – 25 of 66) sorted by relevance

123

/mbedtls-latest/tests/suites/
Dtest_suite_constant_time.function40 mbedtls_ct_condition_t expected = (v != 0) ? MBEDTLS_CT_TRUE : MBEDTLS_CT_FALSE;
42 TEST_EQUAL(mbedtls_ct_bool(v), expected);
59 mbedtls_ct_condition_t expected = x1 ? MBEDTLS_CT_FALSE : MBEDTLS_CT_TRUE;
60 TEST_EQUAL(mbedtls_ct_bool_not(mbedtls_ct_bool(x)), expected);
62 expected = x1 != y1 ? MBEDTLS_CT_TRUE : MBEDTLS_CT_FALSE;
63 TEST_EQUAL(mbedtls_ct_uint_ne(x, y), expected);
65 expected = x1 == y1 ? MBEDTLS_CT_TRUE : MBEDTLS_CT_FALSE;
66 TEST_EQUAL(mbedtls_ct_uint_eq(x, y), expected);
68 expected = x1 > y1 ? MBEDTLS_CT_TRUE : MBEDTLS_CT_FALSE;
69 TEST_EQUAL(mbedtls_ct_uint_gt(x, y), expected);
[all …]
Dtest_suite_alignment.function57 /* Define expected result by manually aligning the raw bytes, and
63 /* Make a 16/32/64 byte read from the aligned location, and copy to expected */
64 uint64_t expected = 0;
67 expected = *raw_aligned_16;
70 expected = *raw_aligned_32;
73 expected = raw_aligned_64;
77 TEST_EQUAL(r, expected);
107 uint64_t input = 0, expected = 0;
109 TEST_ASSERT(parse_hex_string(expected_str, &expected));
111 /* Check against expected result */
[all …]
Dtest_suite_asn1write.function30 const data_t *expected, int ret)
34 if (data->size < expected->len) {
41 expected->x, expected->len);
57 void mbedtls_asn1_write_null(data_t *expected)
62 for (data.size = 0; data.size <= expected->len + 1; data.size++) {
67 if (!generic_write_finish_step(&data, expected, ret)) {
79 void mbedtls_asn1_write_bool(int val, data_t *expected)
84 for (data.size = 0; data.size <= expected->len + 1; data.size++) {
89 if (!generic_write_finish_step(&data, expected, ret)) {
107 void mbedtls_asn1_write_int(int val, data_t *expected)
[all …]
Dtest_suite_psa_crypto_low_hash.function27 data_t *expected)
31 size_t output_size = expected->len;
39 ASSERT_COMPARE(expected->x, expected->len, output, length);
44 output_size = expected->len + 1;
49 ASSERT_COMPARE(expected->x, expected->len, output, length);
167 void hash_empty(int alg_arg, data_t *expected)
171 size_t output_size = expected->len;
182 ASSERT_COMPARE(expected->x, expected->len, output, length);
191 ASSERT_COMPARE(expected->x, expected->len, output, length);
203 ASSERT_COMPARE(expected->x, expected->len, output, length);
Dtest_suite_platform_printf.function50 char *expected = NULL;
56 TEST_CALLOC(expected, n + 1);
57 expected[0] = '7';
58 memset(expected + 1, 'f', sizeof(value) * 2 - 1);
62 TEST_MEMORY_COMPARE(expected, n + 1, output, n + 1);
68 mbedtls_free(expected);
Dtest_suite_cipher.function425 iv_len = 13; /* For CCM, IV length is expected to be between 7 and 13 bytes.
441 int expected = (cipher_info->mode == MBEDTLS_MODE_GCM ||
445 TEST_EQUAL(expected, mbedtls_cipher_update_ad(&ctx_dec, ad, sizeof(ad) - i));
446 TEST_EQUAL(expected, mbedtls_cipher_update_ad(&ctx_enc, ad, sizeof(ad) - i));
465 TEST_EQUAL(expected, mbedtls_cipher_write_tag(&ctx_enc, tag, sizeof(tag)));
486 TEST_EQUAL(expected, mbedtls_cipher_check_tag(&ctx_dec, tag, sizeof(tag)));
542 int expected = (cipher_info->mode == MBEDTLS_MODE_GCM ||
546 TEST_EQUAL(expected, mbedtls_cipher_update_ad(&ctx, NULL, 0));
620 int expected = (cipher_info->mode == MBEDTLS_MODE_GCM ||
624 TEST_EQUAL(expected, mbedtls_cipher_update_ad(&ctx_dec, NULL, 0));
[all …]
Dtest_suite_dhm.function6 const mbedtls_mpi *expected)
13 TEST_ASSERT(mbedtls_mpi_cmp_mpi(&actual, expected) == 0);
22 * syntax and check that the value is the expected one (taken from the
24 static int check_dhm_param_output(const mbedtls_mpi *expected,
41 TEST_EQUAL(n, mbedtls_mpi_size(expected));
44 TEST_EQUAL(0, mbedtls_mpi_cmp_mpi(expected, &actual));
Dtest_suite_base64.function37 signed char expected;
44 expected = -1;
46 expected = p - base64_digits;
52 TEST_EQUAL(actual, expected);
Dtest_suite_psa_crypto_pake.function256 … !"One of the last psa_pake_input() calls should have returned the expected error.");
350 … !"One of the last psa_pake_input() calls should have returned the expected error.");
383 … !"One of the last psa_pake_input() calls should have returned the expected error.");
439 … !"One of the last psa_pake_input() calls should have returned the expected error.");
503 … !"One of the last psa_pake_input() calls should have returned the expected error.");
530 … !"One of the last psa_pake_input() calls should have returned the expected error.");
549 * - terminated successfully if this exact error was expected at this stage
550 * - terminated with failure otherwise (either no error was expected at this
551 * stage or a different error code was expected)
572 * The test succeeds if the returned error is exactly the expected one,
Dtest_suite_psa_crypto_storage_format.function14 * Test that it has the expected representation.
36 /* Check that the key is represented as expected. */
161 /* Check that the injected key exists and looks as expected. */
228 * check that it has the expected format so that future versions
Dtest_suite_ecp.function851 // Read expected parameters
868 // Compare group with expected parameters
904 // Read group from buffer and compare with expected ID
1183 void mbedtls_ecp_read_key(int grp_id, data_t *in_key, int expected, int canonical)
1196 TEST_ASSERT(ret == expected);
1198 if (expected == 0) {
1230 expected);
1242 expected);
1353 void genkey_mx_known_answer(int bits, data_t *seed, data_t *expected)
1366 TEST_CALLOC(actual, expected->len);
[all …]
Dtest_suite_ecdsa.function120 /* Check we generated the expected values */
496 void ecdsa_verify(int grp_id, char *x, char *y, char *r, char *s, data_t *content, int expected)
517 /* Test whether public key has expected validity */
519 expected == MBEDTLS_ERR_ECP_INVALID_KEY ? MBEDTLS_ERR_ECP_INVALID_KEY : 0);
524 TEST_EQUAL(result, expected);
Dtest_suite_psa_crypto_hash.function66 // manual comparison against expected MAC
69 // use psa_mac_verify to compare to expected MAC
Dtest_suite_aes.function92 void aes_ctr(data_t *key, data_t *ictr, data_t *pt, data_t *ct, int expected)
105 // expected result is always success on zero-length input, so skip len == 0 if expecting failure
106 for (size_t len = (expected == 0 ? 0 : 1); len <= pt->len; len++) {
121 TEST_ASSERT(!!memcmp(output, ct->x, len) == expected);
126 TEST_ASSERT(!!memcmp(output, pt->x, len) == expected);
Dtest_suite_lmots.data91 # alters the random value (C) of the signature, and is expected to fail to
97 # sets an invalid LMOTS type (0x5), and is expected to fail to
103 # sets an invalid LMOTS type (0x3), and is expected to fail to
Dtest_suite_bignum_core.function13 * \param[in] S Little-endian presentation of the expected sum.
89 * \param[in] S Little-endian presentation of the expected sum.
591 mbedtls_mpi_uint *S = NULL; /* expected result */
624 mbedtls_mpi_uint *x = NULL; /* expected */
815 * The data file contains the expected result for sizeof(mbedtls_mpi_uint) == 8;
850 mbedtls_mpi_init(&X4); /* expected result, sizeof(mbedtls_mpi_uint) == 4 */
851 mbedtls_mpi_init(&X8); /* expected result, sizeof(mbedtls_mpi_uint) == 8 */
1001 /* Calculated rr matches expected value */
1093 * expected value. Bytes above wanted_bytes must be zero. */
Dtest_suite_ecdh.function371 data_t *expected)
411 TEST_ASSERT(shared_secret_length == expected->len);
412 TEST_ASSERT(memcmp(expected->x, shared_secret,
Dtest_suite_pkwrite.function120 * that the writing functions fails as expected. */
144 * that the writing functions fails as expected. */
Dtest_suite_psa_crypto_se_driver_hal.function91 * case, the test driver code is expected to have called mbedtls_test_fail()
610 /* Check that the persistent data of a driver has its expected content. */
929 /* Test that the key was created in the expected slot. */
961 /* Test that the key was created in the expected slot. */
1070 /* Test that the key was created in the expected slot. */
1074 * including the expected slot. */
1515 /* Test that the key exists and has the expected attributes. */
/mbedtls-latest/tests/scripts/
Dcomponents-basic-checks.sh88 expected="check-test-deps-expected-$$"
98 rm -f $expected
100 echo "!MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH" >> $expected
102 echo "!MBEDTLS_BLOCK_CIPHER_NO_DECRYPT" >> $expected
108 echo "MBEDTLS_ASN1_WRITE_C" >> $expected
110 echo "MBEDTLS_ECP_RESTARTABLE" >> $expected
112 echo "MBEDTLS_ENTROPY_NV_SEED" >> $expected
114 echo "MBEDTLS_THREADING_PTHREAD" >> $expected
125 diff -U0 $expected $found
127 rm $found $expected
Drun-metatests.sh10 metatest is expected to report a failure. The final line should be
/mbedtls-latest/docs/architecture/testing/
Ddriver-interface-test-strategy.md25 …the proper function is called, that it receives the expected inputs and that it produces the expec…
41 …ons involve multiple driver methods; these should validate that all the expected driver methods ar…
45 … register multiple drivers with a key in each driver and check that the expected driver is called.…
46 …cture with multiple lifetime values and check that the driver receives the expected lifetime value.
56expected inputs reach the driver. This may be implicit in a test that checks the outputs if the on…
70 * Check that the storage ends up in the expected state. At least make sure that no intermediate fil…
90 * Check both that the storage has the expected content (this can be done by e.g. using a key that i…
Dpsa-storage-format-testing.md23expected state of the storage after the key is created. The test case creates a key as indicated b…
25 In addition, the test case also loads the key and checks that it has the expected data and metadata…
39 … the corresponding test cases in load-only mode: create a file with the expected content, load it …
62 …ven identifier (using `psa_import_key`) and verify that a file with the expected name is created, …
68 …th `psa_import_key`. Read the file content and validate that it has the expected layout, deduced f…
/mbedtls-latest/docs/architecture/psa-migration/
Dtesting.md43 (`mbedtls_pk_get_type()` etc.) work and the functions that are expected to
44 fail (`mbedtls_pk_verify()` etc) return the expected error.
46 check that signature generation works as expected
48 exporting (writing out) the public part of the key works as expected and
49 that exporting the private key fails as expected.
/mbedtls-latest/programs/psa/
Dcrypto_examples.c22 #define ASSERT_STATUS(actual, expected) \ argument
25 if ((actual) != (expected)) \
29 (psa_status_t) actual, (psa_status_t) expected); \

123