rsa-checksum.h 727 B

1234567891011121314151617181920212223242526272829
  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. #include <u-boot/sha512.h>
  12. /**
  13. * hash_calculate() - Calculate hash over the data
  14. *
  15. * @name: Name of algorithm to be used for hash calculation
  16. * @region: Array having info of regions over which hash needs to be calculated
  17. * @region_count: Number of regions in the region array
  18. * @checksum: Buffer contanining the output hash
  19. *
  20. * @return 0 if OK, < 0 if error
  21. */
  22. int hash_calculate(const char *name,
  23. const struct image_region region[], int region_count,
  24. uint8_t *checksum);
  25. #endif