Safeheron-SGX-Native-Development-Framework v1.2.0
Loading...
Searching...
No Matches
ssgx_utils_t.h
Go to the documentation of this file.
1#ifndef SAFEHERON_SGX_TRUSTED_UTILS_H
2#define SAFEHERON_SGX_TRUSTED_UTILS_H
3
4#include <cstdint>
5#include <cstdio>
6#include <string>
7
8#include "sgx_eid.h"
9
11#include "ssgx_utils_t_time.h"
12#include "ssgx_utils_t_uuid.h"
14
15namespace ssgx {
16
35namespace utils_t {
36
66int Printf(const char* fmt, ...);
67
91std::string FormatStr(const char* fmt, ...);
92
125void* MallocOutside(size_t size);
126
161void* CallocOutside(size_t num, size_t size);
162
189void FreeOutside(void* ptr_outside, size_t size);
190
217char* StrndupOutside(const char * str_ptr, std::size_t str_len);
218
242void* MemcpyToOutside(void* dest_outside_enclave, const void* src, std::size_t count);
243
269void* MemdupOutside(const void* buf_ptr, std::size_t buf_size);
270
275void Sleep(uint32_t seconds);
276
277} // namespace utils_t
278} // namespace ssgx
279
280#endif // SAFEHERON_SGX_TRUSTED_UTILS_H
std::string FormatStr(const char *fmt,...)
Format args according to the format string fmt, and return the result as a string.
void * CallocOutside(size_t num, size_t size)
Allocates memory outside the enclave for an array of num objects of size and initializes all bytes in...
char * StrndupOutside(const char *str_ptr, std::size_t str_len)
Duplicates a fixed-length C-style string to memory allocated outside the enclave.
void * MemdupOutside(const void *buf_ptr, std::size_t buf_size)
Duplicates a raw memory buffer to memory allocated outside the enclave.
void * MemcpyToOutside(void *dest_outside_enclave, const void *src, std::size_t count)
Copies count bytes from the object pointed to by src to the object outside the enclave pointed to by ...
void Sleep(uint32_t seconds)
Sleep for a specified number of seconds using OCall.
void FreeOutside(void *ptr_outside, size_t size)
Deallocates the space previously allocated by MallocOutside(), CallocOutside().
void * MallocOutside(size_t size)
Allocates size bytes of uninitialized storage outside the enclave.
int Printf(const char *fmt,...)
Print formatted data to stdout.
Definition ssgx_attestation_t.h:6