120a14a42SAndy Fleming /* 220a14a42SAndy Fleming * This file was transplanted with slight modifications from Linux sources 320a14a42SAndy Fleming * (fs/cifs/md5.h) into U-Boot by Bartlomiej Sieka <tur@semihalf.com>. 420a14a42SAndy Fleming */ 520a14a42SAndy Fleming 620a14a42SAndy Fleming #ifndef _MD5_H 720a14a42SAndy Fleming #define _MD5_H 820a14a42SAndy Fleming 9*37566090SMike Frysinger #include "compiler.h" 1020a14a42SAndy Fleming 1120a14a42SAndy Fleming struct MD5Context { 1220a14a42SAndy Fleming __u32 buf[4]; 1320a14a42SAndy Fleming __u32 bits[2]; 1420a14a42SAndy Fleming unsigned char in[64]; 1520a14a42SAndy Fleming }; 1620a14a42SAndy Fleming 1720a14a42SAndy Fleming /* 1820a14a42SAndy Fleming * Calculate and store in 'output' the MD5 digest of 'len' bytes at 1920a14a42SAndy Fleming * 'input'. 'output' must have enough space to hold 16 bytes. 2020a14a42SAndy Fleming */ 2120a14a42SAndy Fleming void md5 (unsigned char *input, int len, unsigned char output[16]); 2220a14a42SAndy Fleming 23215b01bbSBartlomiej Sieka /* 24215b01bbSBartlomiej Sieka * Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'. 25215b01bbSBartlomiej Sieka * 'output' must have enough space to hold 16 bytes. If 'chunk' Trigger the 26215b01bbSBartlomiej Sieka * watchdog every 'chunk_sz' bytes of input processed. 27215b01bbSBartlomiej Sieka */ 28215b01bbSBartlomiej Sieka void md5_wd (unsigned char *input, int len, unsigned char output[16], 29215b01bbSBartlomiej Sieka unsigned int chunk_sz); 30215b01bbSBartlomiej Sieka 3120a14a42SAndy Fleming #endif /* _MD5_H */ 32