News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Drizz Bignum lib

Started by ragdog, January 14, 2013, 12:11:42 AM

Previous topic - Next topic

ragdog

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,

dedndave

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/
i don't see an e-mail address

ragdog

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

Gunther

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

You have to know the facts before you can distort them.

ragdog

Yes this is this last build

qWord

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.)
MREAL macros - when you need floating point arithmetic while assembling!

ragdog

Exact this is a problem.

Give from the Mircal lib a masm32 include?