md5.h 856 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * This file was transplanted with slight modifications from Linux sources
  3. * (fs/cifs/md5.h) into U-Boot by Bartlomiej Sieka <tur@semihalf.com>.
  4. */
  5. #ifndef _MD5_H
  6. #define _MD5_H
  7. #include "compiler.h"
  8. struct MD5Context {
  9. __u32 buf[4];
  10. __u32 bits[2];
  11. union {
  12. unsigned char in[64];
  13. __u32 in32[16];
  14. };
  15. };
  16. /*
  17. * Calculate and store in 'output' the MD5 digest of 'len' bytes at
  18. * 'input'. 'output' must have enough space to hold 16 bytes.
  19. */
  20. void md5 (unsigned char *input, int len, unsigned char output[16]);
  21. /*
  22. * Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'.
  23. * 'output' must have enough space to hold 16 bytes. If 'chunk' Trigger the
  24. * watchdog every 'chunk_sz' bytes of input processed.
  25. */
  26. void md5_wd (unsigned char *input, int len, unsigned char output[16],
  27. unsigned int chunk_sz);
  28. #endif /* _MD5_H */