Tamas Ban | 64c33a1 | 2022-01-11 20:24:24 +0100 | [diff] [blame] | 1 | # |
| 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. |
| 12 | TPM_HASH_ALG := sha256 |
| 13 | |
| 14 | ifeq (${TPM_HASH_ALG}, sha512) |
| 15 | MBOOT_ALG_ID := MBOOT_ALG_SHA512 |
| 16 | MBOOT_DIGEST_SIZE := 64U |
| 17 | else ifeq (${TPM_HASH_ALG}, sha384) |
| 18 | MBOOT_ALG_ID := MBOOT_ALG_SHA384 |
| 19 | MBOOT_DIGEST_SIZE := 48U |
| 20 | else |
| 21 | MBOOT_ALG_ID := MBOOT_ALG_SHA256 |
| 22 | MBOOT_DIGEST_SIZE := 32U |
| 23 | endif #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 | |
| 33 | MEASURED_BOOT_SRC_DIR := drivers/measured_boot/rss/ |
| 34 | |
| 35 | MEASURED_BOOT_SOURCES += ${MEASURED_BOOT_SRC_DIR}rss_measured_boot.c |