2 * This file was transplanted with slight modifications from Linux sources
9 #include <linux/kconfig.h>
11 #if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
12 #include <mbedtls/md5.h>
16 #define MD5_SUM_LEN 16
17 #define MD5_DEF_CHUNK_SZ 0x10000
19 #if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
20 typedef mbedtls_md5_context MD5Context;
22 typedef struct MD5Context {
32 void MD5Init(MD5Context *ctx);
33 void MD5Update(MD5Context *ctx, unsigned char const *buf, unsigned int len);
34 void MD5Final(unsigned char digest[16], MD5Context *ctx);
37 * Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'.
38 * 'output' must have enough space to hold 16 bytes. If 'chunk' Trigger the
39 * watchdog every 'chunk_sz' bytes of input processed.
41 void md5_wd(const unsigned char *input, unsigned int len,
42 unsigned char output[16], unsigned int chunk_sz);