Is there someone who knows where I can find
Source code of The Rsa algorythm in asm,
I search information(lib,source) about programming
with Big Numbers too.


Posted on 2002-01-07 05:01:24 by Farad77
The easiest solution is to find one of the few bignum or RSA libraries
that are already out there. I don't know of any RSA assembly implementations.
Without being very familiar with the algorithm, I think the speed
bottleneck lies mostly in the bignum library though?

Look up miracl, freelip, gnu MP. And look around for ready-made
crypto libraries.
Posted on 2002-01-07 05:07:29 by f0dder
Hello fOdder!
Thank You for your answer,
The miracl library (as far as i know) doesn't use RSA algorythm but i'll search for a new version
I'm looking for freelip!
If someone have a link!

Posted on 2002-01-07 06:44:49 by Farad77
In fact miracl uses RSA but its a C++ library
Posted on 2002-01-07 06:51:58 by Farad77
you can get Freelip from:

i believe Roy was working on a bignum library for ASM :cool: .. i'm looking forward to it :)
Posted on 2002-01-07 06:55:10 by savage
Thanks a lot!!
This ftp is full of precious informations

Farad77 :grin: :grin:
Posted on 2002-01-07 11:05:53 by Farad77
first, for farad77, a library doesn' t need to have an rsa function built in. to make some rsa encryption/decryption, you only need a powmod function, what miracl has =)
second, for savage =) well, i' m working on that lib, but :
1. it *is* slow =)
2. i' m getting a bit stuck on the bigdiv, i couldn' t find something easy to implement and effective, and i don' t have much time, but i' ll try to finish it anyway. when the div will be finished, i' ll implement quickly a mulmod and powmod, and i' ll publish it.
note that you shouldn' t use my lib for any factoring need, or dlp-solving need, as it will *be* slow =)
else, that' s what i already implemented :

_BigCreate (dword)InitValue
creates a bignum and initializes it with the value InitValue
returns a pointer to the bignum

_BigDestroy (big *)Big
destroys the bignum Big

_BigCopy (big *)BigSrc, (big *)BigDest
copies BigSrc to BigDest

_BigCompare (big *)BigA, (big *)BigB
compares BigA and BigB
returns 1 if BigA > BigB
0 if BigA = BigB
-1 if BigA < BigB

_BigCompare32 (big *)BigA, (dword)Value
compares BigA and Value
returns 1 if BigA > Value
0 if BigA = Value
-1 if BigA < Value

_BigFill (char *)Data, (dword)Len, (big *)Big
fills Big with Len bytes of Data

_BigFill32 (dword)Value, (big *)Big
fills Big with Value

_BigFillHex (char *)Hex, (big *)Big
fills Big with hexadecimal value of the null-terminated string Hex

_BigStore (big *)Big, (char *)Buffer
fills Buffer with the value of Big

_BigWrite (big *)Big, (char *)Buffer
writes the hexadecimal value of Big as a null-terminated string in Buffer
returns the length of the string without the terminating null byte

_BigAdd32 (big *)BigX, (dword)Value, (big *)BigY
BigY = BigX + Value

_BigAdd (big *)BigX, (big *)BigY, (big *)BigZ
BigZ = BigX + BigY

_BigSub32 (big *)BigX, (dword)Value, (big *)BigY
BigY = |BigX - Value|

_BigSub (big *)BigX, (big *)BigY, (big *)BigZ
BigZ = |BigX - BigY|

_BigShr (big *)BigX, (big *)BigY
BigY = BigX >> 1
returns the previous lower bit

_BigShl (big *)BigX, (big *)BigY
BigY = BigX << 1

_BigMul (big *)BigX, (big *)BigY, (big *)BigZ
BigZ = BigX * BigY
Posted on 2002-01-07 12:15:50 by roy

only the mod_exp routines if i remember it good, but who needs more? they are asm and heavily speed optimized


Posted on 2002-01-07 14:43:50 by lifewire
i'm also developing a bignum 'library' in asm. got a bit more functions done than you, roy, but mine are also slow as hell ;) guess i should be using more sophisticated algorithms ;)
Posted on 2002-01-07 15:45:12 by Tola
Thank you Lifewire,
i didn't succed in making you librarie work yet!
but i'm downloading rsa4!and hope i could make the library work!
Posted on 2002-01-07 16:56:16 by Farad77
A possible resource for this thread is Ch 20.6 of "Numerical Recipes in C" by Press, Teukolsky et al, 'Arithmetic at arbitrary precision'. It is geared more towards arbitrary precision floating point rather than bignums but still holds useful information: you do all use DFTs for multiplication , don't you? Me, I cheat. I do all my bignums in Mathematica.
Posted on 2002-01-07 23:37:27 by peterverstappen
Lifewire,i didn't succed at least to make your
library work!
I've tried to translate the code for my prog and compiler,but i'm not used with tasm source
i'm just a newbie and when i make the change
for masm,the prog crashed because of an
mov ,...
and edi=00000000
I'll try to download tasm to see;but
if someone could explain me it would be great :)
Posted on 2002-01-08 12:03:49 by Farad77
hey tola, i' d like to see your bignum library, maybe we can publish what we have, and inspire =) to see how it is going
as you wish
Posted on 2002-01-08 13:31:53 by roy