pub/dh-kcdsa.c: Free the correct factor.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 23 Oct 2019 03:10:27 +0000 (04:10 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 16 Dec 2019 17:13:12 +0000 (17:13 +0000)
pub/dh-kcdsa.c

index e773309..5feda92 100644 (file)
@@ -88,7 +88,7 @@ int dh_kcdsagen(dh_param *dp, unsigned ql, unsigned pl,
   dp->q = pgen("p", MP_NEW, x, ev, ec,
               steps, pgen_simulstep, &ss,
               rabin_iters(ql), pgen_simultest, &ss);
   dp->q = pgen("p", MP_NEW, x, ev, ec,
               steps, pgen_simulstep, &ss,
               rabin_iters(ql), pgen_simultest, &ss);
-  mp_drop(sp[0].mul);
+  mp_drop(sp[1].mul);
   if (!dp->q)
     goto fail_1;
   dp->p = sp[1].u.x;
   if (!dp->q)
     goto fail_1;
   dp->p = sp[1].u.x;