Marco Russo wrote:
> 
> ----- Original Message -----
> From: "Ben Laurie" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 17, 2001 7:18 PM
> Subject: Re: BN_rand question
> 
> > Marco Russo wrote:
> > >
> > > I need to generate a random polynomial in Zp, with p very large
> (1024-2048
> > > bits).
> > > Sorry for my math...:-(,
> > > but I think that with your method the problem is that the numbers in [0,
> > > p-1] are equally likely only if
> > > (2^(n - 1))mod p = 0, where n is the number of bits in input to BN_rand
> > > (there are 2^(n-1) numbers of
> > > n bits, from 10...00 to 11...11).
> > > Finding  an n such that (2^(n - 1))mod p = 0 is really hard....
> > >
> > > Another way could be to fill an array A of bits.
> >
> > What??? That's what BN_rand already does!
> 
> Ah ..ok! I thought that the MSD of the number generatated form BN_rand was
> 1:-(!

Only if you ask for it to be.

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to