xref: /openbmc/u-boot/include/u-boot/md5.h (revision 215b01bb)
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 
920a14a42SAndy Fleming #include <linux/types.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 
23*215b01bbSBartlomiej Sieka /*
24*215b01bbSBartlomiej Sieka  * Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'.
25*215b01bbSBartlomiej Sieka  * 'output' must have enough space to hold 16 bytes. If 'chunk' Trigger the
26*215b01bbSBartlomiej Sieka  * watchdog every 'chunk_sz' bytes of input processed.
27*215b01bbSBartlomiej Sieka  */
28*215b01bbSBartlomiej Sieka void md5_wd (unsigned char *input, int len, unsigned char output[16],
29*215b01bbSBartlomiej Sieka 		unsigned int chunk_sz);
30*215b01bbSBartlomiej Sieka 
3120a14a42SAndy Fleming #endif /* _MD5_H */
32