Lines Matching refs:a

9 #define TEST_COMPARE_MPI_RESIDUES(a, b) \
10 TEST_MEMORY_COMPARE((a).p, (a).limbs * sizeof(mbedtls_mpi_uint), \
237 mbedtls_mpi_mod_residue a = { NULL, 0 };
252 * with a non-zero final parameter. */
253 TEST_EQUAL(0, test_read_residue(&a, &m, input_A, expected_ret != 0));
267 mbedtls_mpi_mod_sub(&x, &a, &b, &m));
279 mbedtls_mpi_mod_sub(&x, &a, &b, &m));
285 /* Negative testing with too many/too few limbs in a and b is covered by
293 /* a - b => Correct result, or expected error */
294 TEST_EQUAL(expected_ret, mbedtls_mpi_mod_sub(&x, &a, &b, &m));
301 /* a - b: alias x to a => Correct result */
302 memcpy(x.p, a.p, bytes);
306 /* a - b: alias x to b => Correct result */
308 TEST_EQUAL(0, mbedtls_mpi_mod_sub(&x, &a, &x, &m));
311 if (memcmp(a.p, b.p, bytes) == 0) {
312 /* a == b: alias a and b */
314 /* a - a => Correct result */
315 TEST_EQUAL(0, mbedtls_mpi_mod_sub(&x, &a, &a, &m));
318 /* a - a: x, a, b all aliased together => Correct result */
319 memcpy(x.p, a.p, bytes);
328 mbedtls_free(a.p);
340 mbedtls_mpi_mod_residue a = { NULL, 0 }; /* argument */
354 * with a non-zero final parameter. */
355 TEST_EQUAL(0, test_read_residue(&a, &N, input_A, expected_ret != 0));
365 TEST_EQUAL(expected_ret, mbedtls_mpi_mod_inv(&x, &a, &N));
369 /* a^-1: alias x to a => Correct result */
370 memcpy(x.p, a.p, bytes);
379 mbedtls_free(a.p);
390 mbedtls_mpi_mod_residue a = { NULL, 0 }; /* argument */
404 * with a non-zero final parameter. */
405 TEST_EQUAL(0, test_read_residue(&a, &N, input_A, expected_ret != 0));
415 TEST_EQUAL(expected_ret, mbedtls_mpi_mod_inv(&x, &a, &N));
419 /* a^-1: alias x to a => Correct result */
420 memcpy(x.p, a.p, bytes);
429 mbedtls_free(a.p);
440 mbedtls_mpi_mod_residue a = { NULL, 0 };
455 * with a non-zero final parameter. */
456 TEST_EQUAL(0, test_read_residue(&a, &m, input_A, expected_ret != 0));
470 mbedtls_mpi_mod_add(&x, &a, &b, &m));
482 mbedtls_mpi_mod_add(&x, &a, &b, &m));
488 /* Negative testing with too many/too few limbs in a and b is covered by
498 TEST_EQUAL(expected_ret, mbedtls_mpi_mod_add(&x, &a, &b, &m));
505 /* a + b: alias x to a => Correct result */
506 memcpy(x.p, a.p, bytes);
510 /* a + b: alias x to b => Correct result */
512 TEST_EQUAL(0, mbedtls_mpi_mod_add(&x, &a, &x, &m));
515 if (memcmp(a.p, b.p, bytes) == 0) {
516 /* a == b: alias a and b */
518 /* a + a => Correct result */
519 TEST_EQUAL(0, mbedtls_mpi_mod_add(&x, &a, &a, &m));
522 /* a + a: x, a, b all aliased together => Correct result */
523 memcpy(x.p, a.p, bytes);
532 mbedtls_free(a.p);
602 /* Do the rest of the tests with a residue set up with the input data */
676 /* Read a copy for checking that writing didn't change the value of r */