blob: 54e6a73744e1fe3861abb464c31164ff4537e593 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Heiko Schocher646257d2014-03-03 12:19:26 +01002/*
3 * Copyright (c) 2013, Andreas Oetken.
Tom Rini83d290c2018-05-06 17:58:06 -04004 */
Heiko Schocher646257d2014-03-03 12:19:26 +01005
6#ifndef _RSA_CHECKSUM_H
7#define _RSA_CHECKSUM_H
8
9#include <errno.h>
10#include <image.h>
Jeroen Hofstee2b9912e2014-06-12 22:27:12 +020011#include <u-boot/sha1.h>
12#include <u-boot/sha256.h>
Reuben Dowled16b38f2020-04-16 17:36:52 +120013#include <u-boot/sha512.h>
Heiko Schocher646257d2014-03-03 12:19:26 +010014
Ruchika Guptab37b46f2015-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 Schocher646257d2014-03-03 12:19:26 +010028
29#endif