| 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 |
MBOOT_RSE_HASH_ALG := sha256 |
| 10 |
|
| 11 |
ifeq (${MBOOT_RSE_HASH_ALG}, sha512) |
| 12 |
MBOOT_ALG_ID := MBOOT_ALG_SHA512 |
| 13 |
MBOOT_DIGEST_SIZE := 64U |
| 14 |
else ifeq (${MBOOT_RSE_HASH_ALG}, sha384) |
| 15 |
MBOOT_ALG_ID := MBOOT_ALG_SHA384 |
| 16 |
MBOOT_DIGEST_SIZE := 48U |
| 17 |
else |
| 18 |
MBOOT_ALG_ID := MBOOT_ALG_SHA256 |
| 19 |
MBOOT_DIGEST_SIZE := 32U |
| 20 |
endif #MBOOT_RSE_HASH_ALG |
| 21 |
|
| 22 |
# Set definitions for Measured Boot driver. |
| 23 |
$(eval $(call add_defines,\ |
| 24 |
$(sort \ |
| 25 |
MBOOT_ALG_ID \ |
| 26 |
MBOOT_DIGEST_SIZE \ |
| 27 |
MBOOT_RSE_BACKEND \ |
| 28 |
))) |
| 29 |
|
| 30 |
MEASURED_BOOT_SRC_DIR := drivers/measured_boot/rse/ |
| 31 |
|
| 32 |
MEASURED_BOOT_SOURCES += ${MEASURED_BOOT_SRC_DIR}rse_measured_boot.c |