X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/0f00dc4c8eb47e67bc0f148c2dd109f73a451e0a..23a83acc57af124c24226d5df3676862c31be4f1:/pub/dh-kcdsa.c diff --git a/pub/dh-kcdsa.c b/pub/dh-kcdsa.c index e7733095..4de00c66 100644 --- a/pub/dh-kcdsa.c +++ b/pub/dh-kcdsa.c @@ -68,7 +68,7 @@ int dh_kcdsagen(dh_param *dp, unsigned ql, unsigned pl, int i; mp *x; - /* --- First trick: find %$q$% --- */ + /* --- First trick: find %$v$% --- */ pf.step = 2; x = mprand(MP_NEW, pl - ql, r, 1); @@ -78,7 +78,7 @@ int dh_kcdsagen(dh_param *dp, unsigned ql, unsigned pl, if (!x) goto fail_0; - /* --- Second trick: find %$p$% and %$v$% --- */ + /* --- Second trick: find %$p$% and %$q$% --- */ x = mp_lsl(x, x, 1); sp[0].add = MP_ZERO; sp[0].mul = MP_ONE; sp[0].f = 0; @@ -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); - mp_drop(sp[0].mul); + mp_drop(sp[1].mul); if (!dp->q) goto fail_1; dp->p = sp[1].u.x;