54 lines
No EOL
1.5 KiB
C
54 lines
No EOL
1.5 KiB
C
#ifndef MD2_REF_H
|
|
#define MD2_REF_H
|
|
|
|
/***********************************************************
|
|
* WICHTIG:
|
|
* Diese Implementierung wurde nicht von uns geschrieben,
|
|
* sondern zu vergleichszwechen von der Referenz übernommen.
|
|
* Quelle: https://datatracker.ietf.org/doc/html/rfc1319
|
|
**********************************************************/
|
|
|
|
#ifndef PROTOTYPES
|
|
#define PROTOTYPES 0
|
|
#endif
|
|
|
|
/* POINTER defines a generic pointer type */
|
|
typedef unsigned char *POINTER;
|
|
|
|
/* UINT2 defines a two byte word */
|
|
typedef unsigned short int UINT2;
|
|
|
|
/* UINT4 defines a four byte word */
|
|
typedef unsigned long int UINT4;
|
|
|
|
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
|
|
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
|
|
returns an empty list.
|
|
*/
|
|
#if PROTOTYPES
|
|
#define PROTO_LIST(list) list
|
|
#else
|
|
#define PROTO_LIST(list) ()
|
|
#endif
|
|
|
|
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 *));
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <sys/types.h>
|
|
|
|
void md2_hash_ref(size_t len, const uint8_t buf[len], uint8_t out[16]);
|
|
|
|
#endif // MD2_REF_H
|