/* Benchmark_Enclave.edl - Top EDL file. */
enclave {
    include "wolfssl/ssl.h"
    include "wolfssl/wolfcrypt/settings.h"
    include "wolfssl/wolfcrypt/types.h"

    include "wolfcrypt/test/test.h"
    include "wolfcrypt/benchmark/benchmark.h"

    trusted {
        public int wc_test([user_check]void* args);
        public int wc_benchmark_test([user_check]void* args);

        public int enc_wolfSSL_Init(void);
        public void enc_wolfSSL_Debugging_ON(void);
        public void enc_wolfSSL_Debugging_OFF(void);
        public long enc_wolfTLSv1_2_client_method(void);
        public long enc_wolfTLSv1_2_server_method(void);
        public long enc_wolfSSL_CTX_new(long method);
        public int enc_wolfSSL_CTX_use_PrivateKey_buffer(long ctxId,
                                                         [in, size=sz] const unsigned char* buf,
                                                          long sz, int type);
        public int enc_wolfSSL_CTX_load_verify_buffer(long ctxId,
                                                      [in, size=sz] const unsigned char* buf,
                                                       long sz, int type);
        public int enc_wolfSSL_CTX_use_certificate_chain_buffer_format(long ctxId,
                                                                       [in, size=sz] const unsigned char* buf,
                                                                        long sz, int type);
        public int enc_wolfSSL_CTX_use_certificate_buffer(long ctxId,
                                                [in, size=sz] const unsigned char* buf,
                                                long sz,
                                                int type);
        public int enc_wolfSSL_CTX_set_cipher_list(long ctxId,
                                                [in, string] const char* list);
        public long enc_wolfSSL_new(long ctxId);
        public int enc_wolfSSL_set_fd(long sslId, int fd);
        public int enc_wolfSSL_connect(long sslId);
        public int enc_wolfSSL_write(long sslId,
                                     [in, size=sz] const void* in,
                                     int sz);
        public int enc_wolfSSL_get_error(long sslId,
                                         int ret);
        public int enc_wolfSSL_read(long sslId,
                                    [out, size=sz]void* out,
                                    int sz);
        public void enc_wolfSSL_free(long sslId);
        public void enc_wolfSSL_CTX_free(long ctxId);
        public int enc_wolfSSL_Cleanup(void);
    };

    untrusted {
        /* define OCALLs here. */
        void ocall_print_string([in, string] const char* str);
        void ocall_current_time([out] double* time);
        void ocall_low_res_time([out] int* time);
        size_t ocall_recv(int sockfd, [out, size=len] void *buf, size_t len, int flags) propagate_errno;
        size_t ocall_send(int sockfd, [in, size=len] const void *buf, size_t len, int flags) propagate_errno;
    };
};
