gra-projekt/Implementierung/lib/md2.h

28 lines
No EOL
694 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);
#endif // MD2_H