X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/912c70abe824cf6a99fc3db98f3550f570e6d83c..318c3c31be343fdba362cb60f33aab3e88798d8a:/math/ec-test.c diff --git a/math/ec-test.c b/math/ec-test.c index d9cda6ff..ff01a2ea 100644 --- a/math/ec-test.c +++ b/math/ec-test.c @@ -215,6 +215,8 @@ const test_type type_ec = { eccvt, ecdump }; #ifdef TEST_RIG +#include + static void ecdestroy(ec_curve *c) { field *f = c->f; @@ -354,7 +356,7 @@ static int vec2osp(dstr v[]) int ok = 1; int win, wantwin; - if (strcmp(v[3].buf, "FAIL") == 0) wantwin = 0; + if (STRCMP(v[3].buf, ==, "FAIL")) wantwin = 0; else { wantwin = 1; type_hex.cvt(v[3].buf, &d); } dstr_ensure(&dd, n); buf_init(&b, dd.buf, n); @@ -362,7 +364,7 @@ static int vec2osp(dstr v[]) win = !ec_ec2osp(e, f, &b, p); if (!win != !wantwin || (win && (BLEN(&b) != d.len || - memcmp(BBASE(&b), d.buf, BLEN(&b)) != 0))) { + MEMCMP(BBASE(&b), !=, d.buf, BLEN(&b))))) { ok = 0; fprintf(stderr, "ec2osp failed"); fprintf(stderr, "\ncurve = "); type_ecurve.dump(v, stderr); @@ -393,7 +395,7 @@ static int vos2ecp(dstr v[]) int ok = 1; int win; - if (strcmp(v[3].buf, "FAIL") == 0) p = 0; + if (STRCMP(v[3].buf, ==, "FAIL")) p = 0; else { type_ec.cvt(v[3].buf, &d); p = (ec *)d.buf; } buf_init(&b, v[2].buf, v[2].len);