mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 07:19:20 +00:00
Added MD5 checksum (https://github.com/Zunawe/md5-c)
This commit is contained in:
37
include/md5.h
Normal file
37
include/md5.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef __FENNIX_KERNEL_MD5_H__
|
||||
#define __FENNIX_KERNEL_MD5_H__
|
||||
|
||||
#include <types.h>
|
||||
|
||||
/*
|
||||
https://github.com/Zunawe/md5-c
|
||||
*/
|
||||
|
||||
START_EXTERNC
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint64_t size; // Size of input in bytes
|
||||
uint32_t buffer[4]; // Current accumulation of hash
|
||||
uint8_t input[64]; // Input to be used in the next step
|
||||
uint8_t digest[16]; // Result of algorithm
|
||||
} MD5Context;
|
||||
|
||||
void md5Init(MD5Context *ctx);
|
||||
void md5Update(MD5Context *ctx, uint8_t *input, size_t input_len);
|
||||
void md5Finalize(MD5Context *ctx);
|
||||
void md5Step(uint32_t *buffer, uint32_t *input);
|
||||
|
||||
uint8_t *md5String(char *input);
|
||||
uint8_t *md5File(uint8_t *buffer, size_t input_len);
|
||||
|
||||
uint32_t F(uint32_t X, uint32_t Y, uint32_t Z);
|
||||
uint32_t G(uint32_t X, uint32_t Y, uint32_t Z);
|
||||
uint32_t H(uint32_t X, uint32_t Y, uint32_t Z);
|
||||
uint32_t I(uint32_t X, uint32_t Y, uint32_t Z);
|
||||
|
||||
uint32_t rotateLeft(uint32_t x, uint32_t n);
|
||||
|
||||
END_EXTERNC
|
||||
|
||||
#endif // !__FENNIX_KERNEL_MD5_H__
|
Reference in New Issue
Block a user