The MASM Forum

General => The Campus => Topic started by: ragdog on January 14, 2013, 12:11:42 AM

Title: Drizz Bignum lib
Post by: ragdog on January 14, 2013, 12:11:42 AM
Hi all

I use the BigNumlib from drizz in my project and have found a bug
Have any the email address from drizz?

I have only found this "1of00 AT gmx.net"

i am writing a program to create RSA keys like, p,q,d,n
using drizz's BigNum.lib
Now the flow is that a user should choose the keysize of n.
Knowing this when i get the keysize i divide it by 2 to get the keysize of p and q
but there is a problem using this method i never get the keysize that is wanted for n!

any idea how to circumvent this problem using the BigNum lib of drizz?


LOCAL p,q,n,e,d,phi,m,ct,z,x,y,a
pushad
RSATestBits equ 300  ;  > plain
invoke bnInit,RSATestBits
bnCreateX p,q,n,e,phi,d,m,ct,z

invoke Writeln,T("generating p...")
invoke bnRsaGenPrime,p,RSATestBits/2
invoke printbn,p
invoke Writeln,T("generating q...")
invoke bnRsaGenPrime,q,RSATestBits/2




Greets,
Title: Re: Drizz Bignum lib
Post by: dedndave on January 14, 2013, 01:11:08 AM
haven't seen him around for a while   :(

but, i do know that his bignum library is in an "experimental" stage
meaning - use at your own risk - all things may not be perfect   :P

http://www.drizz.eu.pn/ (http://www.drizz.eu.pn/)
i don't see an e-mail address
Title: Re: Drizz Bignum lib
Post by: ragdog on January 14, 2013, 03:43:59 AM
Yes i know

But it works only is a bug in this  bnRandom

bnRsaGenPrime proc bn:dword, nbit:dword
call _bn_dwrandomize
invoke bnRandom,bn,nbit             <<<<<<<<<<<<<<


It alloc to many or to little bit´s (dwords)

And i have the last Bignum lib from Drizz site
Title: Re: Drizz Bignum lib
Post by: Gunther on January 14, 2013, 04:50:04 AM
Hi ragdog,

Quote from: ragdog on January 14, 2013, 03:43:59 AM
And i have the last Bignum lib from Drizz site

but it's from March 2010, nearly 3 years ago.

Gunther

Title: Re: Drizz Bignum lib
Post by: ragdog on January 14, 2013, 05:05:26 AM
Yes this is this last build
Title: Re: Drizz Bignum lib
Post by: qWord on January 14, 2013, 05:16:11 AM
looking into the source, you can find that bnRandom divides the number of bits nbit by 32 and discards the modulo - so it seems like that you can only get n*32 bits.
(Even it seems like that the library only work with multiples of DWORDs.)
Title: Re: Drizz Bignum lib
Post by: ragdog on January 14, 2013, 05:45:05 AM
Exact this is a problem.

Give from the Mircal lib a masm32 include?