Commit feec2348 authored by Niels Möller's avatar Niels Möller
Browse files

Updated benchmarking of mpn_sec_powm.

parent 4d364ccd
2014-09-22 Niels Möller <>
* examples/ecc-benchmark.c (bench_modinv_powm, bench_curve):
Updated benchmarking of mpn_sec_powm.
* ecc-internal.h (struct ecc_curve): Deleted redc function
pointer. Use only reduce pointer, which is redc or modp as
applicable. Updated all users.
......@@ -195,10 +195,10 @@ bench_modinv_powm (void *p)
const struct ecc_curve *ecc = ctx->ecc;
mp_size_t size = ecc->p.size;
mpn_sub_1 (ctx->rp + size, ecc->p, size, 2);
mpn_sub_1 (ctx->rp + size, ecc->p.m, size, 2);
mpn_sec_powm (ctx->rp, ctx->ap, size,
ctx->rp + size, ecc->bit_size,
ecc->p, size, ctx->tp);
ctx->rp + size, ecc->p.bit_size,
ecc->p.m, size, ctx->tp);
......@@ -280,7 +280,7 @@ bench_curve (const struct ecc_curve *ecc)
#ifdef mpn_sec_powm
mp_size_t powm_itch
= mpn_sec_powm_itch (ecc->p.size, ecc->bit_size, ecc->p.size);
= mpn_sec_powm_itch (ecc->p.size, ecc->p.bit_size, ecc->p.size);
if (powm_itch > itch)
itch = powm_itch;
Supports Markdown
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