| 12345678910111213141516171819202122232425262728 |
- #ifndef MD5_H_EX1
- #define MD5_H_EX1
- #include <stdint.h>
- #include <stddef.h>
- #define MD5_BLOCK_SIZE 64
- #define MD5_DIGEST_SIZE 16
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef struct {
- uint32_t state[4];
- uint32_t count[2];
- uint8_t buffer[MD5_BLOCK_SIZE];
- } MD5_CTXEx1;
- // 基础MD5函数
- void MD5_InitEx1(MD5_CTXEx1 *ctx);
- void MD5_UpdateEx1(MD5_CTXEx1 *ctx, const uint8_t *input, size_t len);
- void MD5_FinalEx1(uint8_t digest[MD5_DIGEST_SIZE], MD5_CTXEx1 *ctx);
- // 便捷函数
- void md5_hexEx1(const char *input, char *output);
- void md5_bytesEx1(const uint8_t *input, size_t len, char *output);
- void md5_tripleEx1(const char *input, char *output);
- // 工具函数
- void bytes_to_hexEx1(const uint8_t *bytes, size_t len, char *hex_str);
- #ifdef __cplusplus
- }
- #endif
- #endif
|