gra-projekt/Implementierung/lib/md2.h
2022-06-29 19:03:12 +02:00

30 lines
No EOL
748 B
C

#ifndef MD2_H
#define MD2_H
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
/**
* @brief Calculates checksum of buf and stores it in out
*
* @param len Length of the data at buf
* @param buf Location of the data
* @param out Destination array of for the checksum
*/
void md2_hash(size_t len, const uint8_t buf[], uint8_t out[16]);
/**
* @brief Calculates checksum of buf and appends it to buf
*
* @param len Length of data which the checksum should be calculated of
* @param buf Location of the data. Make sure to reserve 16 bytes more so the
* chechsum fits!
*/
void md2_checksum(size_t len, uint8_t* buf);
void encodeHash(uint8_t hash[16], char* stringHash);
#endif // MD2_H