* testsuite/testutils.c (die): Use plain vfprintf, not
gmp_vfprintf.
+ (write_mpn): New function.
+ (test_ecc_point): Use it, replacing gmp_fprintf.
+ * testsuite/testutils.h (write_mpn): Declare it.
* der-iterator.c: Deleted HAVE_LIBGMP conditionals.
const char *y;
};
+void
+write_mpn (FILE *f, int base, const mp_limb_t *xp, mp_size_t n)
+{
+ mpz_t t;
+ mpz_out_str (f, base, mpz_roinit_n (t,xp, n));
+}
+
static void
test_ecc_point (const struct ecc_curve *ecc,
const struct ecc_ref_point *ref,
if (! (test_mpn (ref->x, p, ecc->size)
&& test_mpn (ref->y, p + ecc->size, ecc->size) ))
{
- gmp_fprintf (stderr, "Incorrect point!\n"
- "got: x = %Nx\n"
- " y = %Nx\n"
- "ref: x = %s\n"
- " y = %s\n",
- p, ecc->size, p + ecc->size, ecc->size,
- ref->x, ref->y);
+ fprintf (stderr, "Incorrect point!\n"
+ "got: x = ");
+ write_mpn (stderr, 16, p, ecc->size);
+ fprintf (stderr, "\n"
+ " y = ");
+ write_mpn (stderr, 16, p + ecc->size, ecc->size);
+ fprintf (stderr, "\n"
+ "ref: x = %s\n"
+ " y = %s\n",
+ ref->x, ref->y);
abort();
}
}
mp_limb_t *
xalloc_limbs (mp_size_t n);
+void
+write_mpn (FILE *f, int base, const mp_limb_t *xp, mp_size_t n);
+
void
test_rsa_set_key_1(struct rsa_public_key *pub,
struct rsa_private_key *key);