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