blob: 5efce9fccf5581ef9945db8e001ddb08f70243f6 [file] [log] [blame]
Gabor Toth70cb3c62023-05-10 12:40:24 +02001/*
2 * Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <app/ts-demo/ts-demo.h>
8#include <stdio.h>
9#include <string.h>
10#include <unistd.h>
11
Gabor Tothee2e7cb2024-10-07 17:02:56 +020012#include "libpsats.h"
Gabor Toth70cb3c62023-05-10 12:40:24 +020013
14int main(int argc, char *argv[])
15{
16 psa_status_t psa_status = PSA_ERROR_GENERIC_ERROR;
17 const char *service_name = "sn:trustedfirmware.org:crypto:0";
18
19 if (argc > 1)
20 service_name = argv[1];
21
Gabor Tothee2e7cb2024-10-07 17:02:56 +020022 psa_status = libpsats_init_crypto_context(service_name);
Gabor Toth70cb3c62023-05-10 12:40:24 +020023
24 if (psa_status) {
Gabor Tothee2e7cb2024-10-07 17:02:56 +020025 printf("libpsats_init_crypto_context failed: %d\n", psa_status);
Gabor Toth70cb3c62023-05-10 12:40:24 +020026 return psa_status;
27 }
28
29 psa_status = run_ts_demo(true);
30
Gabor Tothee2e7cb2024-10-07 17:02:56 +020031 libpsats_deinit_its_context();
Gabor Toth70cb3c62023-05-10 12:40:24 +020032
33 if (psa_status)
34 printf("\n*** ts-demo failed ***\n\n");
35 else
36 printf("\n*** ts-demo was successful ***\n\n");
37
38 return psa_status;
39}