diff --git a/mpint.c b/mpint.c index 32f21c3f..28b91d81 100644 --- a/mpint.c +++ b/mpint.c @@ -1257,21 +1257,6 @@ MontyContext *monty_new(mp_int *modulus) return mc; } -MontyContext *monty_copy(MontyContext *orig) -{ - MontyContext *mc = snew(MontyContext); - - mc->rw = orig->rw; - mc->pw = orig->pw; - mc->rbits = orig->rbits; - mc->m = mp_copy(orig->m); - mc->minus_minv_mod_r = mp_copy(orig->minus_minv_mod_r); - for (size_t j = 0; j < 3; j++) - mc->powers_of_r_mod_m[j] = mp_copy(orig->powers_of_r_mod_m[j]); - mc->scratch = mp_make_sized(monty_scratch_size(mc)); - return mc; -} - void monty_free(MontyContext *mc) { mp_free(mc->m); diff --git a/mpint.h b/mpint.h index 34b175d9..c27331ab 100644 --- a/mpint.h +++ b/mpint.h @@ -313,7 +313,6 @@ mp_int *mp_modsqrt(ModsqrtContext *sc, mp_int *x, unsigned *success); * pointers are still owned by the MontyContext, so don't free them! */ MontyContext *monty_new(mp_int *modulus); -MontyContext *monty_copy(MontyContext *mc); void monty_free(MontyContext *mc); mp_int *monty_modulus(MontyContext *mc); /* doesn't transfer ownership */ mp_int *monty_identity(MontyContext *mc); /* doesn't transfer ownership */