test(realm): add tests for realm attestation
With this patch, TFTF adds two tests for realm attestation. One tests
the full process of retrieving the attestation token from the host. The
second one triggers a failure by calling RSI_ATTEST_TOKEN_CONTINUE
without calling RSI_ATTEST_TOKEN_INIT first.
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Change-Id: I885402377af1f02ce7e90c80dbe1079fe4c1b178
diff --git a/realm/realm_helpers.c b/realm/realm_helpers.c
new file mode 100644
index 0000000..6a3c57d
--- /dev/null
+++ b/realm/realm_helpers.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <stdlib.h>
+
+/* Generate 64-bit random number */
+unsigned long long realm_rand64(void)
+{
+ return ((unsigned long long)rand() << 32) | rand();
+}
+