crc.h 797 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * (C) Copyright 2009
  3. * Marvell Semiconductor <www.marvell.com>
  4. * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #ifndef _UBOOT_CRC_H
  9. #define _UBOOT_CRC_H
  10. /* lib/crc32.c */
  11. uint32_t crc32 (uint32_t, const unsigned char *, uint);
  12. uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint);
  13. uint32_t crc32_no_comp (uint32_t, const unsigned char *, uint);
  14. /**
  15. * crc32_wd_buf - Perform CRC32 on a buffer and return result in buffer
  16. *
  17. * @input: Input buffer
  18. * @ilen: Input buffer length
  19. * @output: Place to put checksum result (4 bytes)
  20. * @chunk_sz: Trigger watchdog after processing this many bytes
  21. */
  22. void crc32_wd_buf(const unsigned char *input, uint ilen,
  23. unsigned char *output, uint chunk_sz);
  24. #endif /* _UBOOT_CRC_H */