Skip to content
Snippets Groups Projects
Commit feec2348 authored by Niels Möller's avatar Niels Möller
Browse files

Updated benchmarking of mpn_sec_powm.

parent 4d364ccd
Branches
Tags
No related merge requests found
2014-09-22 Niels Möller <nisse@lysator.liu.se> 2014-09-22 Niels Möller <nisse@lysator.liu.se>
* examples/ecc-benchmark.c (bench_modinv_powm, bench_curve):
Updated benchmarking of mpn_sec_powm.
* ecc-internal.h (struct ecc_curve): Deleted redc function * ecc-internal.h (struct ecc_curve): Deleted redc function
pointer. Use only reduce pointer, which is redc or modp as pointer. Use only reduce pointer, which is redc or modp as
applicable. Updated all users. applicable. Updated all users.
......
...@@ -195,10 +195,10 @@ bench_modinv_powm (void *p) ...@@ -195,10 +195,10 @@ bench_modinv_powm (void *p)
const struct ecc_curve *ecc = ctx->ecc; const struct ecc_curve *ecc = ctx->ecc;
mp_size_t size = ecc->p.size; 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, mpn_sec_powm (ctx->rp, ctx->ap, size,
ctx->rp + size, ecc->bit_size, ctx->rp + size, ecc->p.bit_size,
ecc->p, size, ctx->tp); ecc->p.m, size, ctx->tp);
} }
#endif #endif
...@@ -280,7 +280,7 @@ bench_curve (const struct ecc_curve *ecc) ...@@ -280,7 +280,7 @@ bench_curve (const struct ecc_curve *ecc)
#ifdef mpn_sec_powm #ifdef mpn_sec_powm
{ {
mp_size_t powm_itch 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) if (powm_itch > itch)
itch = powm_itch; itch = powm_itch;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment