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

Improved curve25519-dup-test.

parent 71cdc778
2014-07-14 Niels Möller <>
* testsuite/curve25519-dup-test.c (test_main): Add test for 4g.
Delete some left-over debug output.
2014-07-11 Niels Möller <>
* misc/ecc-formulas.tex: Some ECC notes.
......@@ -31,7 +31,7 @@ test_main (void)
mp_limb_t *pe;
mp_limb_t *pa;
mp_limb_t *scratch;
const struct ecc_ref_point g2 =
const struct ecc_ref_point g2 =
{ /* In Edwards coordinates:
x = 0x1a1c31f8665368131698fecfd54233fcdc638bb46d25cc61d8bc4bcdbfbb4459,
y = 0x2260cdf3092329c21da25ee8c9a21f5697390f51643851560e5f46ae6af8a3c9
......@@ -41,6 +41,13 @@ test_main (void)
const struct ecc_ref_point g4 =
g = xalloc_limbs (ecc_size_j (ecc));
z = xalloc_limbs (ecc_size_j (ecc));
......@@ -59,16 +66,14 @@ test_main (void)
ecc_dup_eh (ecc, pe, z, scratch);
if (!point_zero_p (ecc, pe))
die ("dup of zero point failed.\n");
ecc_dup_eh (ecc, pe, g, scratch);
gmp_fprintf (stderr, "g2 (edwards):\n"
"x = %Nx\n"
"y = %Nx\n"
"z = %Nx\n",
pe, ecc->size,
pe + ecc->size, ecc->size,
pe + 2*ecc->size, ecc->size);
ecc_eh_to_a (ecc, 0, pa, pe, scratch);
test_ecc_point (ecc, &g2, pa);
ecc_dup_eh (ecc, pe, pe, scratch);
ecc_eh_to_a (ecc, 0, pa, pe, scratch);
test_ecc_point (ecc, &g4, pa);
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