blob: 01545afeb38cf28dd842ca4b0030e1702d70d6b3 [file] [log] [blame]
Tamas Ban64c33a12022-01-11 20:24:24 +01001#
2# Copyright (c) 2022, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# Hash algorithm for measured boot
8# SHA-256 (or stronger) is required.
9# TODO: The measurement algorithm incorrectly suggests that the TPM backend
10# is used which may not be the case. It is currently being worked on and
11# soon TPM_HASH_ALG will be replaced by a more generic name.
12TPM_HASH_ALG := sha256
13
14ifeq (${TPM_HASH_ALG}, sha512)
15 MBOOT_ALG_ID := MBOOT_ALG_SHA512
16 MBOOT_DIGEST_SIZE := 64U
17else ifeq (${TPM_HASH_ALG}, sha384)
18 MBOOT_ALG_ID := MBOOT_ALG_SHA384
19 MBOOT_DIGEST_SIZE := 48U
20else
21 MBOOT_ALG_ID := MBOOT_ALG_SHA256
22 MBOOT_DIGEST_SIZE := 32U
23endif #TPM_HASH_ALG
24
25# Set definitions for Measured Boot driver.
26$(eval $(call add_defines,\
27 $(sort \
28 MBOOT_ALG_ID \
29 MBOOT_DIGEST_SIZE \
30 MBOOT_RSS_BACKEND \
31)))
32
33MEASURED_BOOT_SRC_DIR := drivers/measured_boot/rss/
34
35MEASURED_BOOT_SOURCES += ${MEASURED_BOOT_SRC_DIR}rss_measured_boot.c