blob: 1bd971f32b17f54f42de889446a30cdebcb1857a [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.
Tamas Ban0a7cf192024-02-21 12:49:34 +01009MBOOT_RSE_HASH_ALG := sha256
Tamas Ban64c33a12022-01-11 20:24:24 +010010
Tamas Ban0a7cf192024-02-21 12:49:34 +010011ifeq (${MBOOT_RSE_HASH_ALG}, sha512)
Tamas Ban64c33a12022-01-11 20:24:24 +010012 MBOOT_ALG_ID := MBOOT_ALG_SHA512
13 MBOOT_DIGEST_SIZE := 64U
Tamas Ban0a7cf192024-02-21 12:49:34 +010014else ifeq (${MBOOT_RSE_HASH_ALG}, sha384)
Tamas Ban64c33a12022-01-11 20:24:24 +010015 MBOOT_ALG_ID := MBOOT_ALG_SHA384
16 MBOOT_DIGEST_SIZE := 48U
17else
18 MBOOT_ALG_ID := MBOOT_ALG_SHA256
19 MBOOT_DIGEST_SIZE := 32U
Tamas Ban0a7cf192024-02-21 12:49:34 +010020endif #MBOOT_RSE_HASH_ALG
Tamas Ban64c33a12022-01-11 20:24:24 +010021
22# Set definitions for Measured Boot driver.
23$(eval $(call add_defines,\
24 $(sort \
25 MBOOT_ALG_ID \
26 MBOOT_DIGEST_SIZE \
Tamas Ban0a7cf192024-02-21 12:49:34 +010027 MBOOT_RSE_BACKEND \
Tamas Ban64c33a12022-01-11 20:24:24 +010028)))
29
Tamas Ban0a7cf192024-02-21 12:49:34 +010030MEASURED_BOOT_SRC_DIR := drivers/measured_boot/rse/
Tamas Ban64c33a12022-01-11 20:24:24 +010031
Tamas Ban0a7cf192024-02-21 12:49:34 +010032MEASURED_BOOT_SOURCES += ${MEASURED_BOOT_SRC_DIR}rse_measured_boot.c