Crypt::DH 0.4

Brad Fitzpatrick brad at danga.com
Mon Jun 6 15:51:47 PDT 2005


On Mon, 6 Jun 2005, Paul Crowley wrote:

> Brad Fitzpatrick wrote:
> >    http://www.danga.com/dist/misc/Crypt-DH-0.04.tar.gz
>
> Shouldn't the argument to Crypt::Random be this?
>
> makerandom_itv(Strength => 0, Lower => 1, Upper => $dh->{p} -1)

The docs say Upper is an exclusive bound, while Lower is inclusive.

So:

  makerandom_itv(Strength => 0, Lower => 1, Upper => $dh->{p})

Right?

The _makerandom fix is easy enough.  Easiest is just making sure the $bits
substr used matches /1/ first.  (but yeah, then you leave off a whole
bunch of potential random numbers with that first bit set.... as it's
currently called with bitsize - 1 for bits)

Sanity check me.  :)


More information about the yadis mailing list