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 937566090SMike Frysinger #include "compiler.h" 1020a14a42SAndy Fleming 1120a14a42SAndy Fleming struct MD5Context { 1220a14a42SAndy Fleming __u32 buf[4]; 1320a14a42SAndy Fleming __u32 bits[2]; 14*b68d63ceSMarek Vasut union { 1520a14a42SAndy Fleming unsigned char in[64]; 16*b68d63ceSMarek Vasut __u32 in32[16]; 17*b68d63ceSMarek Vasut }; 1820a14a42SAndy Fleming }; 1920a14a42SAndy Fleming 2020a14a42SAndy Fleming /* 2120a14a42SAndy Fleming * Calculate and store in 'output' the MD5 digest of 'len' bytes at 2220a14a42SAndy Fleming * 'input'. 'output' must have enough space to hold 16 bytes. 2320a14a42SAndy Fleming */ 2420a14a42SAndy Fleming void md5 (unsigned char *input, int len, unsigned char output[16]); 2520a14a42SAndy Fleming 26215b01bbSBartlomiej Sieka /* 27215b01bbSBartlomiej Sieka * Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'. 28215b01bbSBartlomiej Sieka * 'output' must have enough space to hold 16 bytes. If 'chunk' Trigger the 29215b01bbSBartlomiej Sieka * watchdog every 'chunk_sz' bytes of input processed. 30215b01bbSBartlomiej Sieka */ 31215b01bbSBartlomiej Sieka void md5_wd (unsigned char *input, int len, unsigned char output[16], 32215b01bbSBartlomiej Sieka unsigned int chunk_sz); 33215b01bbSBartlomiej Sieka 3420a14a42SAndy Fleming #endif /* _MD5_H */ 35