
				  .@@  @@     .@@.   @@  @@   .@@
				 @@    @@    @@  @@  @@  @@  @@
				 @@    @@    @@  @@  @@  @@  @@
				 @@@@  @@    @@@@'   @@  @@  @@
				 @@    @@    @@      @@  @@  @@
				 @@    @@    @@      @@  @@  @@
				 **    **    **      **  **  **
				 	'   '     ''   

				    	f   l	e   u	r   
________________________________________________________________________________________________
::::::::::::::::::::::::::::::::::: i n f o r m a t i o n s ::::::::::::::::::::::::::::::::::::

	 biglib v. 0.01e
	 biglib is an assembly bignum library
	 i can' t be held responsible for what you do with this library, or any damage or data
	  loss that might result from it' s use
	 the library doesn' t handle signed bignumbers
	 the library uses VirtualAlloc and VirtualFree (kernel32.dll)
	 the library is quite slow, i haven' t coded particularly fast algorithm, i just wanted
	  to have an asm bignum library that gives the correct results =)
	 beware : if you make an error in one of the parameter of a function, it may result in
	  a program crash
	 the routines protect ebx, ecx, edi and esi
	 functions :

	_BigCreate (dword)InitValue
	[LIBcore.asm]
	creates a bignum and initializes it with the value InitValue
	returns a pointer to the bignum

	_BigDestroy (big *)Big
	[LIBcore.asm]
	destroys the bignum Big

	_BigCopy (big *)BigSrc, (big *)BigDest
	[LIBcore.asm]
	copies BigSrc to BigDest

	_BigCompare (big *)BigA, (big *)BigB
	[LIBcore.asm]
	compares BigA and BigB
	returns 1 if BigA > BigB
		0 if BigA = BigB
	       -1 if BigA < BigB

	_BigCompare32 (big *)BigA, (dword)Value
	[LIBcore.asm]
	compares BigA and Value
	returns 1 if BigA > Value
		0 if BigA = Value
	       -1 if BigA < Value

	_BigInB256 (char *)Data, (dword)Len, (big *)Big
	[LIBio.asm]
	fills Big with Len bytes of Data in base 256

	_BigIn32 (dword)Value, (big *)Big
	[LIBio.asm]
	fills Big with Value

	_BigIn (char *)String, (dword)Base, (big *)Big
	[LIBio.asm]
	fills Big with the null-terminated string String in base Base (Base is 2-62)
	returns 0 if no error, -1 if base not supported

	_BigInBytes (char *)Buffer, (dword)Len, (dword)Base, (big *)Big
	[LIBio.asm]
	fills Big with Len bytes of data at Buffer in base Base (Base is 2-256)
	returns 0 if no error, -1 if base not supported

	_BigOutB256 (big *)Big, (char *)Buffer
	[LIBio.asm]
	fills Buffer with the value of Big in base 256
	returns the length of the string

	_BigOutB16 (big *)Big, (char *)Buffer
	[LIBio.asm]
	fills Buffer with the value of Big in base 16 as a null-terminated string
	returns the length of the string not including the terminating null character

	_BigOut (big *)Big, (dword)dtBase, (char *)Buffer
	[LIBio.asm]
	fills Buffer with the value of Big in base Base as a null-terminated string (Base is 2-62 or 256)
	returns the length of the string not including the terminating null character, -1 if base not supported

	_BigOutBytes (big *)Big, (dword)dtBase, (char *)Buffer
	[LIBio.asm]
	fills Buffer with the value of Big in base Base as data (Base is 2-256)
	returns the length of the data not including the terminating null character, -1 if base not supported

	_BigAdd32 (big *)BigX, (dword)Value, (big *)BigY
	[LIBbigadd.asm]
	BigY = BigX + Value

	_BigAdd (big *)BigX, (big *)BigY, (big *)BigZ
	[LIBbigadd.asm]
	BigZ = BigX + BigY

	_BigSub32 (big *)BigX, (dword)Value, (big *)BigY
	[LIBbigsub.asm]
	BigY = |BigX - Value|

	_BigSub (big *)BigX, (big *)BigY, (big *)BigZ
	[LIBbigsub.asm]
	BigZ = |BigX - BigY|

	_BigShr (big *)BigX, (big *)BigY
	[LIBbigshift.asm]
	BigY = BigX >> 1
	returns the previous lower bit

	_BigShl (big *)BigX, (big *)BigY
	[LIBbigshift.asm]
	BigY = BigX << 1

	_BigMul32 (big *)BigX, (dword)Value, (big *)BigY
	[LIBbigmul.asm]
	BigY = BigX * Value

	_BigMul (big *)BigX, (big *)BigY, (big *)BigZ
	[LIBbigmul.asm]
	BigZ = BigX * BigY

	_BigDiv32 (big *)BigX, (dword)Value, (big*)BigY, (big *)BigR
	[LIBbigdiv.asm]
	BigY = BigX / Value
	BigR = BigX mod Value
	if pointer to BigY is 0, only remainder is returned
	if pointer to BigR is 0, only quotient is returned
	returns remainder, -1 if division by zero

	_BigDiv (big *)BigX, (big *)BigY, (big *)BigZ, (big *)BigR
	[LIBbigdiv.asm]
	BigZ = BigX / BigY
	BigR = BigX mod BigY
	if pointer to BigZ is 0, only remainder is returned
	if pointer to BigR is 0, only quotient is returned
	returns 0 if no error
	returns -1 if division by zero

	_BigMod (big *)BigX, (big *)BigY, (big *)BigZ
	[LIBbigmod.asm]
	BigZ = BigX mod BigY
	returns 0 if no error
	returns -1 if division by zero

	_BigMulMod (big *)BigX, (big *)BigY, (big *)BigN, (big *)BigZ
	[LIBbigmulmod.asm]
	BigZ = BigX * BigY mod BigN
	returns 0 if no error
	returns -1 if division by zero

	_BigPowMod32 (big *)BigX, (dword)E, (big *)BigN, (big *)BigZ
	[LIBbigpowmod.asm]
	BigZ = BigX ^ E mod BigN
	returns 0 if no error
	returns -1 if division by zero

	_BigPowMod (big *)BigX, (big *)BigY, (big *)BigN, (big *)BigZ
	[LIBbigpowmod.asm]
	BigZ = BigX ^ BigY mod BigN
	returns 0 if no error
	returns -1 if division by zero

	_BigGcd (big *)BigX, (big *)BigY, (big *)BigZ
	[LIBbiggcd.asm]
	BigZ = g.c.d.(BigX,BigY)
________________________________________________________________________________________________
:::::::::::::::::::::::::::::::::::::::: v e r s i o n :::::::::::::::::::::::::::::::::::::::::

	 v. 0.01e :
	  fixed a bug in _BigMod, memory wouldn' t be deallocated

	 v. 0.01d :
	  some bugs corrections in _BigSub32
	  _BigInBytes, _BigOutBytes

	 v. 0.01c :
	  some bugs corrections in _BigOut

	 v. 0.01b :
	  _BigInB256, _BigIn32, _BigIn, _BigOutB256, _BigOutB16 and _BigOut replace the old i/o
	  routines
	  _BigMul32, _BigDiv32

	 v. 0.01a :
	  _BigCreate, _BigDestroy, _BigCopy, _BigCompare, _BigCompare32, _BigFill, _BigFill32,
	  _BigFillHex, _BigStore, _BigWrite, _BigAdd32, _BigAdd, _BigSub32, _BigSub, _BigShr,
	  _BigShl, _BigMul, _BigDiv, _BigMod, _BigMulMod, _BigPowMod32, _BigPowMod
________________________________________________________________________________________________
:::::::::::::::::::::::::::::::::::: f i n a l   w o r d s :::::::::::::::::::::::::::::::::::::

	 you can use and modify this library as you wish
	 you can download the latest version at http://www.effervescence.com
________________________________________________________________________________________________
										      roy|fleur

