blob: 18ee836184c3eeab25b249c3df8889ea0fe8b036 [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.
laurenw-arm7834aa02022-05-31 16:39:09 -05009MBOOT_RSS_HASH_ALG := sha256
Tamas Ban64c33a12022-01-11 20:24:24 +010010
laurenw-arm7834aa02022-05-31 16:39:09 -050011ifeq (${MBOOT_RSS_HASH_ALG}, sha512)
Tamas Ban64c33a12022-01-11 20:24:24 +010012 MBOOT_ALG_ID := MBOOT_ALG_SHA512
13 MBOOT_DIGEST_SIZE := 64U
laurenw-arm7834aa02022-05-31 16:39:09 -050014else ifeq (${MBOOT_RSS_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
laurenw-arm7834aa02022-05-31 16:39:09 -050020endif #MBOOT_RSS_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 \
27 MBOOT_RSS_BACKEND \
28)))
29
30MEASURED_BOOT_SRC_DIR := drivers/measured_boot/rss/
31
32MEASURED_BOOT_SOURCES += ${MEASURED_BOOT_SRC_DIR}rss_measured_boot.c