Adding Hash Algorithms

The required constant definitions are as follows:

#define MODULE_NAME MD2		/* Name of algorithm */
#define DIGEST_SIZE 16          /* Size of resulting digest in bytes */

The C structure must be named hash_state:

typedef struct {
     ... whatever state variables you need ...
} hash_state;

There are four functions that need to be written: to initialize the algorithm's state, to hash a string into the algorithm's state, to get a digest from the current state, and to copy a state.

Put #include "hash_template.c" at the end of the file to include the actual implementation of the module.