Commit fb2c801d authored by Niels Möller's avatar Niels Möller

Make more of the testsuite use ecc->h_to_a.

parent b8242df2
2014-08-29 Niels Möller <nisse@lysator.liu.se>
* examples/ecc-benchmark.c (bench_add_jjj): Renamed, to...
* testsuite/testutils.c (test_ecc_mul_j): Renamed, to ...
(test_ecc_mul_h): ... new name. Use ecc->h_to_a function pointer.
Updated callers.
* examples/ecc-benchmark.c (bench_add_jjj): Renamed, to ...
(bench_add_hhh): ... new name. Use ecc->add_hhh function pointer.
(bench_add_ehh): Deleted.
(bench_curve): Use bench_add_hhh for all curves. Use ecc->mul_itch
......
......@@ -40,7 +40,7 @@ test_main (void)
for (n[0] = 2; n[0] <= 4; n[0]++)
{
ecc_mul_a (ecc, p, n, ecc->g, scratch);
test_ecc_mul_j (i, n[0], p);
test_ecc_mul_h (i, n[0], p);
}
/* (order - 1) * g = - g */
......
......@@ -42,7 +42,7 @@ test_main (void)
for (n[0] = 2; n[0] <= 4; n[0]++)
{
ecc_mul_g (ecc, p, n, scratch);
test_ecc_mul_j (i, n[0], p);
test_ecc_mul_h (i, n[0], p);
}
/* (order - 1) * g = - g */
......
......@@ -1371,12 +1371,12 @@ test_ecc_mul_a (unsigned curve, unsigned n, const mp_limb_t *p)
}
void
test_ecc_mul_j (unsigned curve, unsigned n, const mp_limb_t *p)
test_ecc_mul_h (unsigned curve, unsigned n, const mp_limb_t *p)
{
const struct ecc_curve *ecc = ecc_curves[curve];
mp_limb_t *np = xalloc_limbs (ecc_size_a (ecc));
mp_limb_t *scratch = xalloc_limbs (ecc_j_to_a_itch(ecc));
ecc_j_to_a (ecc, 0, np, p, scratch);
ecc->h_to_a (ecc, 0, np, p, scratch);
test_ecc_mul_a (curve, n, np);
......
......@@ -239,7 +239,7 @@ void
test_ecc_mul_a (unsigned curve, unsigned n, const mp_limb_t *p);
void
test_ecc_mul_j (unsigned curve, unsigned n, const mp_limb_t *p);
test_ecc_mul_h (unsigned curve, unsigned n, const mp_limb_t *p);
#endif /* WITH_HOGWEED */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment