blob: 2d3b8a86bc05974d4efc6467e84e61a65ca171f0 [file] [log] [blame]
Julius Wernerfdabf3f2020-05-06 17:06:35 -07001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
3
4#ifndef _METADATA_HASH_H_
5#define _METADATA_HASH_H_
6
7#include <commonlib/bsd/metadata_hash.h>
8
9/* Verify the an FMAP data structure with the FMAP hash that is stored together with the CBFS
10 metadata hash in the bootblock's metadata hash anchor (when CBFS verification is enabled). */
11vb2_error_t metadata_hash_verify_fmap(const void *fmap_base, size_t fmap_size);
12
13#if CONFIG(CBFS_VERIFICATION)
14/* Get the (RO) CBFS metadata hash for this CBFS image, which forms the root of trust for CBFS
15 verification. This function is only available in the bootblock. */
16struct vb2_hash *metadata_hash_get(void);
17#else
18static inline struct vb2_hash *metadata_hash_get(void) { return NULL; }
19#endif
20
21#endif