1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2014, STMicroelectronics International N.V. 4 */ 5 6 #ifndef XTEST_UUID_HELPERS_H 7 #define XTEST_UUID_HELPERS_H 8 9 #include <tee_api_defines.h> 10 #include <tee_api_types.h> 11 #include <tee_api_compat.h> 12 13 /* 14 * Convert a UUID string @s into a TEEC_UUID @uuid 15 * Expected format for @s is: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 16 * 'x' being any hexadecimal digit (0-9a-fA-F) 17 */ 18 TEEC_Result xtest_uuid_from_str(TEEC_UUID *uuid, const char *s); 19 20 /* 21 * Convert a TEEC_UUID @uuid into an allocated UUID string @return 22 * Expected format for @return is: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 23 * 'x' being any hexadecimal digit (0-9a-fA-F) 24 */ 25 char *xtest_uuid_to_allocated_str(const TEEC_UUID *uuid); 26 27 #ifdef OPENSSL_FOUND 28 /* 29 * Form UUIDv5 from given name space and name. 30 */ 31 TEEC_Result xtest_uuid_v5(TEEC_UUID *uuid, const TEEC_UUID *ns, 32 const void *name, size_t size); 33 #endif /*OPENSSL_FOUND*/ 34 #endif 35