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. |
laurenw-arm | 7834aa0 | 2022-05-31 16:39:09 -0500 | [diff] [blame] | 9 | MBOOT_RSS_HASH_ALG := sha256 |
Tamas Ban | 64c33a1 | 2022-01-11 20:24:24 +0100 | [diff] [blame] | 10 | |
laurenw-arm | 7834aa0 | 2022-05-31 16:39:09 -0500 | [diff] [blame] | 11 | ifeq (${MBOOT_RSS_HASH_ALG}, sha512) |
Tamas Ban | 64c33a1 | 2022-01-11 20:24:24 +0100 | [diff] [blame] | 12 | MBOOT_ALG_ID := MBOOT_ALG_SHA512 |
| 13 | MBOOT_DIGEST_SIZE := 64U |
laurenw-arm | 7834aa0 | 2022-05-31 16:39:09 -0500 | [diff] [blame] | 14 | else ifeq (${MBOOT_RSS_HASH_ALG}, sha384) |
Tamas Ban | 64c33a1 | 2022-01-11 20:24:24 +0100 | [diff] [blame] | 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 |
laurenw-arm | 7834aa0 | 2022-05-31 16:39:09 -0500 | [diff] [blame] | 20 | endif #MBOOT_RSS_HASH_ALG |
Tamas Ban | 64c33a1 | 2022-01-11 20:24:24 +0100 | [diff] [blame] | 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_RSS_BACKEND \ |
| 28 | ))) |
| 29 | |
| 30 | MEASURED_BOOT_SRC_DIR := drivers/measured_boot/rss/ |
| 31 | |
| 32 | MEASURED_BOOT_SOURCES += ${MEASURED_BOOT_SRC_DIR}rss_measured_boot.c |