> Dear all: > I have some question about parameters pass to bn_rand > from http://www.openssl.org/docs/crypto/BN_rand.html, the top has > 3 choices. > a. -1 most significant bit of the random number can be zero > b. 0 most significant bit of the random number is 1 > c. 1 most significant 2 bit of the random number are 1
> the c is use to let final bits of multiplication of 2 rands will be 2*bits > but what is a, b used for? > what I mean is what is the significant of most significant bit in > rand number? > signed or unsigned? It's just a matter of what you want. If you ask for a "2,048 bit random number" that can mean many things. Arguably, zero is 2,048 bit random number. But sometimes, a "2,048 bit random number" means a number that cannot be expressed in fewer than 2,048 bits. But this only leaves 2^2,047 random bits in it. It has nothing to do with the sign of the number because bn's are not stored in two's complement form. The hight bit is not a sign bit. DS ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org