rsa-checksum.h 700 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2013, Andreas Oetken.
  4. */
  5. #ifndef _RSA_CHECKSUM_H
  6. #define _RSA_CHECKSUM_H
  7. #include <errno.h>
  8. #include <image.h>
  9. #include <u-boot/sha1.h>
  10. #include <u-boot/sha256.h>
  11. /**
  12. * hash_calculate() - Calculate hash over the data
  13. *
  14. * @name: Name of algorithm to be used for hash calculation
  15. * @region: Array having info of regions over which hash needs to be calculated
  16. * @region_count: Number of regions in the region array
  17. * @checksum: Buffer contanining the output hash
  18. *
  19. * @return 0 if OK, < 0 if error
  20. */
  21. int hash_calculate(const char *name,
  22. const struct image_region region[], int region_count,
  23. uint8_t *checksum);
  24. #endif