blob: c240720249623c39f102261381891c267e62d915 [file] [log] [blame]
Heiko Schocheredaf9b12014-03-03 12:19:26 +01001/*
2 * Copyright (c) 2013, Andreas Oetken.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5*/
6
7#ifndef _RSA_CHECKSUM_H
8#define _RSA_CHECKSUM_H
9
10#include <errno.h>
11#include <image.h>
Jeroen Hofsteebfe88fe2014-06-12 22:27:12 +020012#include <u-boot/sha1.h>
13#include <u-boot/sha256.h>
Heiko Schocheredaf9b12014-03-03 12:19:26 +010014
Ruchika Gupta2c8987f2015-01-23 16:01:59 +053015/**
16 * hash_calculate() - Calculate hash over the data
17 *
18 * @name: Name of algorithm to be used for hash calculation
19 * @region: Array having info of regions over which hash needs to be calculated
20 * @region_count: Number of regions in the region array
21 * @checksum: Buffer contanining the output hash
22 *
23 * @return 0 if OK, < 0 if error
24 */
25int hash_calculate(const char *name,
26 const struct image_region region[], int region_count,
27 uint8_t *checksum);
Heiko Schocheredaf9b12014-03-03 12:19:26 +010028
29#endif