Hash functions - TYPE 1
-----------------------

 


xxxInit

xxxInit is the first function to call, it initializes internal buffer
and sets digest to default value. it returns ponter to digest buffer which
can be altered (e.g. setting digest after program restart). it takes no
parameters.

BYTE * __stdcall xxxInit ();

Parameters
    none
Return Values
    pointer to digest bytes
 


xxxUpdate

xxxUpdate is function that updates digest from data hash.
it takes two parameters, first is pointer to data, and second is
data size. returns nothing.

__stdcall xxxUpdate ( BYTE *lpBuffer,DWORD dwBufLen );

Parameters
    lpBuffer - pointer to data
    dwBufLen - size of data
Return Values
    none

 



xxxFinal

xxxFinal is function that gives the final digest
it returns ponter to digest buffer which can be altered but must be copied before
another hashing session (of the same Hash function set).

BYTE * __stdcall xxxFinal ();

Parameters
    none
Return Values
    pointer to digest bytes



Hash functions - TYPE 2 (Haval)
-------------------------------


HavalInit takes two parameters because of variable digest and passes

BYTE * __stdcall HavalInit ( DWORD DigestSizeBits,DWORD Passes );

Parameters
    DigestSizeBits - digest size in bits : 128,160,192,224 or 256
    Passes - number of passes : 3,4 or 5
Return Values
    pointer to digest bytes
 



Crypto functions
----------------


Initialization - Key setup functions

- take either only pointer to key (example: RC5)

__stdcall RC5Init ( BYTE *pKey );

Parameters
    pKey - pointer to key


- or key and variable key len (example:RC6)

__stdcall RC6Init ( BYTE *pKey,DWORD dwKeyLen );

Parameters
    pKey - pointer to key
    dwKeyLen - size of key in bytes
 


Encrypt,Decrypt functions

__stdcall xxxEncrypt ( BYTE *pBlockIn,BYTE *pBlockOut );
__stdcall xxxDecrypt ( BYTE *pBlockIn,BYTE *pBlockOut );


Parameters
    pBlockIn - pointer to memory block
    pBlockOut - pointer to memory block

 




Simple, isn't it?