From: Mark Wooding Date: Wed, 23 Oct 2019 03:11:05 +0000 (+0100) Subject: pub/dh-kcdsa.c: Choose the cofactor size correctly. X-Git-Tag: 2.6.0~38 X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/00e83192c57d476d27b136d6bdf0e6007b4ed2f3?ds=sidebyside;hp=9cbd8bb7d639df855832ee3e3facdeaa903696a8 pub/dh-kcdsa.c: Choose the cofactor size correctly. Considering that we're going to have to multiply in a factor of 2 at some point. --- diff --git a/pub/dh-kcdsa.c b/pub/dh-kcdsa.c index 6bd3e19e..e366a16e 100644 --- a/pub/dh-kcdsa.c +++ b/pub/dh-kcdsa.c @@ -71,7 +71,7 @@ int dh_kcdsagen(dh_param *dp, unsigned ql, unsigned pl, /* --- First trick: find %$v$% --- */ pf.step = 2; - x = mprand(x, pl - ql, r, 1); + x = mprand(x, pl - ql - 1, r, 1); x = pgen("v", x, x, ev, ec, steps, pgen_filter, &pf, rabin_iters(pl - ql), pgen_test, &rb);