Corstone1000: Fix discovery template
Signed-off-by: Mathias Brossard <mathias.brossard@arm.com>
Change-Id: Ifdaf96ee97bdc625299e7e77620c1dc8b014206f
diff --git a/target/trusted-firmware-m/platform/arm/corstone1000/demo-discovery.c b/target/trusted-firmware-m/platform/arm/corstone1000/demo-discovery.c
index d2680c3..c7e7f41 100644
--- a/target/trusted-firmware-m/platform/arm/corstone1000/demo-discovery.c
+++ b/target/trusted-firmware-m/platform/arm/corstone1000/demo-discovery.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2022 Arm Limited. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -58,7 +58,7 @@
#define ED448_VAL
#endif
-#ifdef PSA_ADAC_SM2SM3
+#ifdef PSA_ADAC_SM2SM3
#define SM2SM3_CNT 1
#define SM2SM3_VAL SM_SM2_SM3,
#else
@@ -88,31 +88,32 @@
ED25519_VAL ED448_VAL SM2SM3_VAL HMAC_VAL CMAC_VAL
uint8_t discovery_template[] = {
- // @+00 (12 bytes) psa_auth_version: 1.0
+ /* @+00 (12 bytes) psa_auth_version: 1.0 */
0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00,
- // @+12 (12 bytes) vendor_id: {0x04, 0x3B} => 0x023B ("ARM Ltd.")
+ /* @+12 (12 bytes) vendor_id: {0x04, 0x3B} => 0x023B ("ARM Ltd.") */
0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
0x04, 0x3B, 0x00, 0x00,
- // @+24 (12 bytes) soc_class: [0x00, 0x00, 0x00, 0x00]
+ /* @+24 (12 bytes) soc_class: [0x00, 0x00, 0x00, 0x00] */
0x00, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
- // @+36 (24 bytes) soc_id: [0x00] * 16
+ /* @+36 (24 bytes) soc_id: [0x00] * 16 */
0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // @+60 (12 bytes) psa_lifecycle: PSA_LIFECYCLE_SECURED
+ /* @+60 (12 bytes) psa_lifecycle: PSA_LIFECYCLE_SECURED */
0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x30, 0x00, 0x00,
- // @+72 (12 bytes) token_formats: [{0x00, 0x02} (token_psa_debug)]
+ /* @+72 (12 bytes) token_formats: [{0x00, 0x02} (token_psa_debug)] */
0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00,
- // @+84 (12 bytes) cert_formats: [{0x01, 0x02} (cert_psa_debug)]
+ /* @+84 (12 bytes) cert_formats: [{0x01, 0x02} (cert_psa_debug)] */
0x00, 0x00, 0x01, 0x01, 0x02, 0x00, 0x00, 0x00,
0x01, 0x02, 0x00, 0x00,
- // @+96 (8 + X bytes) cryptosystems: [...]
- 0x00, 0x00, 0x02, 0x01, CRYPTO_CNT, 0x00, 0x00, 0x00,
- CRYPTO_VALS
+ /* @+96 (8 + X bytes) cryptosystems: [...] */
+ 0x00, 0x00, 0x02, 0x01, CRYPTO_CNT, 0x00, 0x00, 0x00, CRYPTO_VALS
+ /* Maximum padding */
+ 0x00, 0x00, 0x00
};
-size_t discovery_template_len = sizeof(discovery_template);
+size_t discovery_template_len = sizeof(discovery_template) - (sizeof(discovery_template) % 4);