36 lines
961 B
C
36 lines
961 B
C
typedef struct {
|
|
unsigned char state[16]; /* state */
|
|
unsigned char checksum[16]; /* checksum */
|
|
unsigned int count; /* number of bytes, modulo 16 */
|
|
unsigned char buffer[16]; /* input buffer */
|
|
} MD2_CTX;
|
|
|
|
void MD2Init PROTO_LIST ((MD2_CTX *));
|
|
void MD2Update PROTO_LIST
|
|
((MD2_CTX *, unsigned char *, unsigned int));
|
|
void MD2Final PROTO_LIST ((unsigned char [16], MD2_CTX *));
|
|
|
|
|
|
#ifndef MD2_REF_H
|
|
#define MD2_REF_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <sys/types.h>
|
|
|
|
#include "../io.h"
|
|
|
|
/**
|
|
* @brief This implementation is the reference implementation
|
|
*
|
|
* @param _ unused
|
|
* @param filename name of the file to load
|
|
* @param out
|
|
*/
|
|
void md2_hash_ref(size_t len, const uint8_t buf[len], uint8_t out[16]);
|
|
void md2_checksum_ref(size_t len, uint8_t* buf);
|
|
|
|
#endif // MD2_REF_H
|