1 /*
2  * Copyright (c) 2021 Nordic Semiconductor ASA.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/kernel.h>
8 #include <tfm_ns_interface.h>
9 
10 #include "dummy_partition.h"
11 
main(void)12 int main(void)
13 {
14 	uint8_t digest[32];
15 
16 	for (int key = 0; key < 6; key++) {
17 		psa_status_t status = dp_secret_digest(key, digest, sizeof(digest));
18 
19 		if (status == PSA_ERROR_INVALID_ARGUMENT && key == 5) {
20 			printk("No valid secret for key, received expected error code\n");
21 		} else if (status != PSA_SUCCESS) {
22 			printk("Status: %d\n", status);
23 		} else {
24 			printk("Digest: ");
25 			for (int i = 0; i < 32; i++) {
26 				printk("%02x", digest[i]);
27 			}
28 			printk("\n");
29 		}
30 	}
31 	return 0;
32 }
33