New API for MD5 production: iso_md5_start(), iso_md5_compute(),

iso_md5_clone(), iso_md5_end()
This commit is contained in:
2009-08-11 12:07:32 +02:00
parent 429b4cd21c
commit fd124c82d2
5 changed files with 191 additions and 53 deletions

View File

@@ -10,29 +10,7 @@
#define LIBISO_MD5_H_
/** Compute a MD5 checksum from one or more calls of this function.
The first call has to be made with flag bit0 == 1. It may already submit
processing payload in data and datalen.
The last call has to be made with bit15 set. Normally bit1 will be set
too in order to receive the checksum before it gets disposed.
bit1 may only be set in the last call or together with bit2.
The combination of bit1 and bit2 may be used to get an intermediate
result without hampering an ongoing checksum computation.
@param ctx the checksum context which stores the state between calls.
It gets created with flag bit0 and disposed with bit15.
With flag bit0, *ctx has to be NULL or point to freeable
memory.
@param data the bytes to be checksummed
@param datalen the number of bytes in data
@param result returns the 16 bytes of checksum if called with bit1 set
@param flag bit0= allocate and init *ctx
bit1= transfer ctx to result
bit2= with bit 0 : clone new *ctx from data
bit15= free *ctx
*/
int libisofs_md5(void **ctx, char *data, int datalen,
char result[16], int flag);
/* The MD5 computation API is in libisofs.h : iso_md5_start() et.al. */
/** Create a writer object for checksums and add it to the writer list of