diff --git a/programs/develop/libraries/kos_mbedtls/README.md b/programs/develop/libraries/kos_mbedtls/README.md deleted file mode 100644 index cdc08844a1..0000000000 --- a/programs/develop/libraries/kos_mbedtls/README.md +++ /dev/null @@ -1 +0,0 @@ -#### port of mbedtls-2.16.6 library for KolibriOS diff --git a/programs/develop/libraries/kos_mbedtls/howto.md b/programs/develop/libraries/kos_mbedtls/howto.md deleted file mode 100644 index 7297d26632..0000000000 --- a/programs/develop/libraries/kos_mbedtls/howto.md +++ /dev/null @@ -1,5 +0,0 @@ -on windows: - - how to build mdebtls static library: - - cd to library/ - - to build: mingw32-make - - to clean: mingw32-make clean WINDOWS=1 \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/include/CMakeLists.txt b/programs/develop/libraries/kos_mbedtls/include/CMakeLists.txt deleted file mode 100644 index c2f2bd4e6f..0000000000 --- a/programs/develop/libraries/kos_mbedtls/include/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) - -if(INSTALL_MBEDTLS_HEADERS) - - file(GLOB headers "mbedtls/*.h") - - install(FILES ${headers} - DESTINATION include/mbedtls - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) - -endif(INSTALL_MBEDTLS_HEADERS) - -# Make config.h available in an out-of-source build. ssl-opt.sh requires it. -if (ENABLE_TESTING AND NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) - link_to_source(mbedtls) -endif() diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/Makefile b/programs/develop/libraries/kos_mbedtls/kosnet/Makefile deleted file mode 100644 index 411e341d71..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -NEWLIB_INCLUDES=D:\KOSSDK\newlib\libc\include - -CC = kos32-gcc -AR = kos32-ar - -CFLAGS ?= -O2 -WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -LDFLAGS ?= - -LOCAL_CFLAGS = $(WARNING_CFLAGS) -I $(NEWLIB_INCLUDES) -I include -D_FILE_OFFSET_BITS=64 -LOCAL_LDFLAGS = - -AR_DASH ?= - -ARFLAGS = $(AR_DASH)src - -OBJS= socket.o network.o dlfcn.o - -.PHONY: all static clean - -all: static - -static: libkosnet.a - -libkosnet.a: $(OBJS) - echo " AR $@" - $(AR) $(ARFLAGS) $@ $(OBJS) - -.c.o: - echo " CC $<" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $< - -clean: -ifndef WINDOWS - rm -f *.o libkosnet.a -else - del /Q /F *.o libkosnet.a -endif diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/dlfcn.c b/programs/develop/libraries/kos_mbedtls/kosnet/dlfcn.c deleted file mode 100644 index 5580009485..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/dlfcn.c +++ /dev/null @@ -1,92 +0,0 @@ -#include -#include - -#include "kosnet/dlfcn.h" -#include "kosnet/kos32sys1.h" - -typedef struct { - char *name; - void *ptr; -} KosExp; - -typedef struct { - void **importNames; - char * libraryName; -} KosImp; - -static int __attribute__ ((stdcall)) dll_Load(KosImp *importTableEntry); - -static const char *__error; - -static int __attribute__ ((stdcall)) dll_Load(KosImp *importTableEntry) { - for (; importTableEntry->importNames; importTableEntry++) { - char libPath[256] = "/sys/lib/"; - KosExp *exports = NULL; - void **libImports = importTableEntry->importNames; - - strcat(libPath, importTableEntry->libraryName); - if (!(exports = dlopen(libPath, 0))) { return 1; } - for (; *libImports; libImports++) { - if (!(*libImports = dlsym(exports, *libImports))) { return 1; } - } - } - return 0; -} - -// https://pubs.opengroup.org/onlinepubs/007908799/xsh/dlopen.html -// Current implementation fully ignores "mode" parameter -void *dlopen(const char *name, int mode) { - KosExp *exports = NULL; - - // load library using syscall - asm volatile ("int $0x40":"=a"(exports):"a"(68), "b"(19), "c"(name)); - if (!exports) { - char libPath[256] = "/sys/lib/"; - - strcat(libPath, name); - asm volatile ("int $0x40":"=a"(exports):"a"(68), "b"(19), "c"(libPath)); - if (!exports) { - __error = "Library not found in \"/sys/lib/\" nor current folder"; - return NULL; - } - } - // call anything starting with "lib_" - for (KosExp *export = exports; export->name; export++) { - if (!memcmp(export->name, "lib_", 4)) { - asm volatile ( - "call *%4" :: - "a"(0), - "b"(0), - "c"(0), - "d"(dll_Load), - "r"(export->ptr)); - // was asm volatile ("call *%4" ::"a"(sysmalloc),"b"(sysfree),"c"(sysrealloc),"d"(dll_Load),"r"(export->ptr)); - } - } - return exports; -} - -// https://pubs.opengroup.org/onlinepubs/007908799/xsh/dlsym.html -void *dlsym(void *handle, const char *name) { - KosExp *exp = handle; - - for (; exp->name; exp++) { - if (!strcmp(exp->name, name)) { - return exp->ptr; - } - } - __error = "Symbol not found"; - return NULL; -} - -// https://pubs.opengroup.org/onlinepubs/007908799/xsh/dlclose.html -int dlclose(void *handle) { - return 0; -} - -// https://pubs.opengroup.org/onlinepubs/007908799/xsh/dlerror.html -char *dlerror(void) { - char *ret = __error ? strdup(__error) : NULL; - __error = NULL; - return ret; -} diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/dlfcn.h b/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/dlfcn.h deleted file mode 100644 index 63ee7c1a96..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/dlfcn.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _DLFCN_H -#define _DLFCN_H - -#define RTLD_LAZY 0x00001 -#define RTLD_NOW 0x00002 -#define RTLD_GLOBAL 0x00100 -#define RTLD_LOCAL 0 - -int dlclose(void *handle); -char *dlerror(void); -void *dlopen(const char *name, int mode); -void *dlsym(void *restrict handle, const char *restrict name); - -#endif \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/kos32sys1.h b/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/kos32sys1.h deleted file mode 100644 index 1f73b4c02c..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/kos32sys1.h +++ /dev/null @@ -1,836 +0,0 @@ -#ifndef __KOS_32_SYS_H__ -#define __KOS_32_SYS_H__ - -#include -#include -typedef unsigned int uint32_t; -typedef int int32_t; -typedef unsigned char uint8_t; -typedef unsigned short int uint16_t; -typedef unsigned long long uint64_t; - -#ifdef __cplusplus -extern "C" { -#endif - -#define TYPE_3_BORDER_WIDTH 5 -#define WIN_STATE_MINIMIZED 0x02 -#define WIN_STATE_ROLLED 0x04 -#define POS_SCREEN 0 -#define POS_WINDOW 1 - -#define IPC_NOBUFFER 1 -#define IPC_LOCKED 2 -#define IPC_OVERFLOW 3 -#define IPC_NOPID 4 - -#define SHM_OPEN 0x00 -#define SHM_OPEN_ALWAYS 0x04 -#define SHM_CREATE 0x08 -#define SHM_READ 0x00 -#define SHM_WRITE 0x01 - -// for clipboard funtions -#define UTF 0 -#define CP866 1 -#define CP1251 2 -#define TEXT 0 -#define IMAGE 1 -#define RAW 2 - -//Read/Write data as type (int char, etc.) at address "addr" with offset "offset". eg DATA(int, buff, 8); -#define DATA(type, addr, offset) *((type*)((uint8_t*)addr+offset)) - -typedef struct { - uint8_t blue; - uint8_t green; - uint8_t red; -}RGB; - -typedef unsigned int color_t; - -typedef union __attribute__((packed)) pos_t -{ - uint32_t val; - struct - { - short x; - short y; - }; -} pos_t; - - -typedef union __attribute__((packed)) oskey_t -{ - uint32_t val; - struct - { - uint8_t state; - uint8_t code; - uint16_t ctrl_key; - }; -} oskey_t; - -typedef struct -{ - unsigned handle; - unsigned io_code; - void *input; - int inp_size; - void *output; - int out_size; -}ioctl_t; - -typedef union -{ - struct - { - void *data; - size_t size; - } x; - unsigned long long raw; -}ufile_t; - -struct kolibri_system_colors { - color_t frame_area; - color_t grab_bar; - color_t grab_bar_button; - color_t grab_button_text; - color_t grab_text; - color_t work_area; - color_t work_button; - color_t work_button_text; - color_t work_text; - color_t work_graph; -}; - - -struct blit_call -{ - int dstx; - int dsty; - int w; - int h; - - int srcx; - int srcy; - int srcw; - int srch; - - void *bitmap; - int stride; -}; - -struct ipc_message -{ - uint32_t pid; // PID of sending thread - uint32_t datalen; // data bytes - char data[0]; // data begin -}; - -struct ipc_buffer -{ - uint32_t lock; // nonzero is locked - uint32_t used; // used bytes in buffer - struct ipc_message data[0]; // data begin -}; - -static inline void begin_draw(void) -{ - __asm__ __volatile__( - "int $0x40" ::"a"(12),"b"(1)); -}; - -static inline -void end_draw(void) -{ - __asm__ __volatile__( - "int $0x40" ::"a"(12),"b"(2)); -}; - -static inline -void sys_create_window(int x, int y, int w, int h, const char *name, - color_t workcolor, uint32_t style) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(0), - "b"((x << 16) | ((w-1) & 0xFFFF)), - "c"((y << 16) | ((h-1) & 0xFFFF)), - "d"((style << 24) | (workcolor & 0xFFFFFF)), - "D"(name), - "S"(0) : "memory"); -}; - -static inline -void sys_change_window(int new_x, int new_y, int new_w, int new_h) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(67), "b"(new_x), "c"(new_y), "d"(new_w),"S"(new_h) - ); -} - - -static inline -void define_button(uint32_t x_w, uint32_t y_h, uint32_t id, uint32_t color) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(8), - "b"(x_w), - "c"(y_h), - "d"(id), - "S"(color)); -}; - -static inline -void draw_line(int xs, int ys, int xe, int ye, color_t color) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(38), "d"(color), - "b"((xs << 16) | xe), - "c"((ys << 16) | ye)); -} - -static inline -void draw_bar(int x, int y, int w, int h, color_t color) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(13), "d"(color), - "b"((x << 16) | w), - "c"((y << 16) | h)); -} - -static inline -void draw_bitmap(void *bitmap, int x, int y, int w, int h) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(7), "b"(bitmap), - "c"((w << 16) | h), - "d"((x << 16) | y)); -} - -static inline -void draw_text_sys(const char *text, int x, int y, int len, color_t color) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(4),"d"(text), - "b"((x << 16) | y), - "S"(len),"c"(color) - :"memory"); -} -static inline -void draw_text_sys_bg(const char *text, int x, int y, int len, color_t color, color_t bg) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(4),"d"(text), - "b"((x << 16) | y), - "S"(len),"c"(color), "D"(bg) - :"memory"); -} - - -static inline -uint32_t get_skin_height(void) -{ - uint32_t height; - - __asm__ __volatile__( - "int $0x40 \n\t" - :"=a"(height) - :"a"(48),"b"(4)); - return height; -}; - -static inline -pos_t get_mouse_pos(int origin) -{ - pos_t val; - - __asm__ __volatile__( - "int $0x40 \n\t" - "rol $16, %%eax" - :"=a"(val) - :"a"(37),"b"(origin)); - return val; -} - -static inline -uint32_t get_mouse_buttons(void) -{ - uint32_t val; - - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(37),"b"(2)); - return val; -}; - -static inline -uint32_t get_mouse_wheels(void) -{ - uint32_t val; - - __asm__ __volatile__( - "int $0x40 \n\t" - :"=a"(val) - :"a"(37),"b"(7)); - return val; -}; - -static inline uint32_t load_cursor(void *path, uint32_t flags) -{ - uint32_t val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(37), "b"(4), "c"(path), "d"(flags)); - return val; -} - -static inline uint32_t set_cursor(uint32_t cursor) -{ - uint32_t old; - __asm__ __volatile__( - "int $0x40" - :"=a"(old) - :"a"(37), "b"(5), "c"(cursor)); - return old; -}; - -static inline int destroy_cursor(uint32_t cursor) -{ - int ret; - __asm__ __volatile__( - "int $0x40" - :"=a"(ret) - :"a"(37), "b"(6), "c"(cursor) - :"memory"); - return ret; -}; - - -static inline -uint32_t wait_for_event(uint32_t time) -{ - uint32_t val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(23), "b"(time)); - return val; -}; - -static inline uint32_t check_os_event() -{ - uint32_t val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(11)); - return val; -}; - -static inline uint32_t get_os_event() -{ - uint32_t val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(10)); - return val; -}; - -static inline -uint32_t get_tick_count(void) -{ - uint32_t val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(26),"b"(9)); - return val; -}; - -static inline -uint64_t get_ns_count(void) -{ - uint64_t val; - __asm__ __volatile__( - "int $0x40" - :"=A"(val) - :"a"(26), "b"(10)); - return val; -}; - -static inline oskey_t get_key(void) -{ - oskey_t val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(2)); - return val; -} - -static inline -uint32_t get_os_button() -{ - uint32_t val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(17)); - return val>>8; -}; - -static inline uint32_t get_service(char *name) -{ - uint32_t retval = 0; - __asm__ __volatile__( - "int $0x40" - :"=a"(retval) - :"a"(68),"b"(16),"c"(name) - :"memory"); - - return retval; -}; - -static inline int call_service(ioctl_t *io) -{ - int retval; - - __asm__ __volatile__( - "int $0x40" - :"=a"(retval) - :"a"(68),"b"(17),"c"(io) - :"memory","cc"); - - return retval; -}; - - -static inline void yield(void) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(68), "b"(1)); -}; - -static inline void delay(uint32_t time) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(5), "b"(time) - :"memory"); -}; - -static inline -void *user_alloc(size_t size) -{ - void *val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(68),"b"(12),"c"(size)); - return val; -} - -static inline -int user_free(void *mem) -{ - int val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(68),"b"(13),"c"(mem)); - return val; -} - -static inline -void* user_realloc(void *mem, size_t size) -{ - void *val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(68),"b"(20),"c"(size),"d"(mem) - :"memory"); - - return val; -}; - -static inline -int *user_unmap(void *base, size_t offset, size_t size) -{ - int *val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(68),"b"(26),"c"(base),"d"(offset),"S"(size)); - return val; -}; - -static inline ufile_t load_file(const char *path) -{ - ufile_t uf; - - __asm__ __volatile__ ( - "int $0x40" - :"=A"(uf.raw) - :"a" (68), "b"(27),"c"(path)); - - return uf; -}; - -static inline int GetScreenSize() -{ - int retval; - - __asm__ __volatile__( - "int $0x40" - :"=a"(retval) - :"a"(61), "b"(1)); - return retval; -} - - -static inline void get_proc_info(char *info) -{ - __asm__ __volatile__( - "int $0x40" - : - :"a"(9), "b"(info), "c"(-1) - :"memory"); -}; - -static inline void Blit(void *bitmap, int dst_x, int dst_y, - int src_x, int src_y, int w, int h, - int src_w, int src_h, int stride) -{ - volatile struct blit_call bc; - - bc.dstx = dst_x; - bc.dsty = dst_y; - bc.w = w; - bc.h = h; - bc.srcx = src_x; - bc.srcy = src_y; - bc.srcw = src_w; - bc.srch = src_h; - bc.stride = stride; - bc.bitmap = bitmap; - - __asm__ __volatile__( - "int $0x40" - ::"a"(73),"b"(0),"c"(&bc.dstx)); -}; - - -// newlib exclusive -#ifndef __TINYC__ -int create_thread(int (*proc)(void *param), void *param, int stack_size); - -void* load_library(const char *name); - -void* get_proc_address(void *handle, const char *proc_name); - -void enumerate_libraries(int (*callback)(void *handle, const char* name, - uint32_t base, uint32_t size, void *user_data), - void *user_data); -#endif - -// May be next section need to be added in newlibc - -enum KOLIBRI_GUI_EVENTS { - KOLIBRI_EVENT_NONE = 0, /* Event queue is empty */ - KOLIBRI_EVENT_REDRAW = 1, /* Window and window elements should be redrawn */ - KOLIBRI_EVENT_KEY = 2, /* A key on the keyboard was pressed */ - KOLIBRI_EVENT_BUTTON = 3, /* A button was clicked with the mouse */ - KOLIBRI_EVENT_DESKTOP = 5, /* Desktop redraw finished */ - KOLIBRI_EVENT_MOUSE = 6, /* Mouse activity (movement, button press) was detected */ - KOLIBRI_EVENT_IPC = 7, /* Interprocess communication notify */ - KOLIBRI_EVENT_NETWORK = 8, /* Network event */ - KOLIBRI_EVENT_DEBUG = 9, /* Debug subsystem event */ - KOLIBRI_EVENT_IRQBEGIN = 16 /* 16..31 IRQ0..IRQ15 interrupt =IRQBEGIN+IRQn */ -}; - - -// copied from /programs/system/shell/system/kolibri.c -// fn's returned -1 as syserror, 1 as error, 0 as OK -static inline -int kol_clip_num() -{ - register uint32_t val; - asm volatile ("int $0x40":"=a"(val):"a"(54), "b"(0)); - return val; -} - -static inline -char* kol_clip_get(int n) -// returned buffer must be freed by user_free() -{ - register char* val; - asm volatile ("int $0x40":"=a"(val):"a"(54), "b"(1), "c"(n)); - return val; -} - -static inline -int kol_clip_set(int n, char buffer[]) -{ - register uint32_t val; - asm volatile ("int $0x40":"=a"(val):"a"(54), "b"(2), "c"(n), "d"(buffer)); - return val; -} - -static inline -int kol_clip_pop() -{ - register uint32_t val; - asm volatile ("int $0x40":"=a"(val):"a"(54), "b"(3)); - return val; -} - -static inline -int kol_clip_unlock() -{ - register uint32_t val; - asm volatile ("int $0x40":"=a"(val):"a"(54), "b"(4)); - return val; -} - -static inline void get_system_colors(struct kolibri_system_colors *color_table) -{ - __asm__ volatile ("int $0x40" - : - :"a"(48),"b"(3),"c"(color_table),"d"(40) - ); - - /* color_table should point to the system color table */ -} - -static inline void debug_board_write_byte(const char ch){ - __asm__ __volatile__( - "int $0x40" - : - :"a"(63), "b"(1), "c"(ch)); -} - - -static inline void draw_number_sys(int32_t number, int x, int y, int len, color_t color){ - register uint32_t fmt; - fmt = len << 16 | 0x80000000; // no leading zeros + width -// fmt = len << 16 | 0x00000000; // leading zeros + width - __asm__ __volatile__( - "int $0x40" - : - :"a"(47), "b"(fmt), "c"(number), "d"((x << 16) | y), "S"(color)); -} - -static inline void draw_number_sys_bg(int32_t number, int x, int y, int len, color_t color, color_t bg){ - register uint32_t fmt; - fmt = len << 16 | 0x80000000; // no leading zeros + width -// fmt = len << 16 | 0x00000000; // leading zeros + width - __asm__ __volatile__( - "int $0x40" - : - :"a"(47), "b"(fmt), "c"(number), "d"((x << 16) | y), "S"(color), "D"(bg)); -} - -static inline -uint32_t get_mouse_eventstate(void) -{ - uint32_t val; - - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(37),"b"(3)); - return val; -}; - -static inline -uint32_t set_event_mask(uint32_t mask) -{ - register uint32_t val; - asm volatile ("int $0x40":"=a"(val):"a"(40), "b"(mask)); - return val; -} - -typedef void (*thread_proc)(void*); - -static inline -int start_thread(thread_proc proc, char* stack_top) -{ - register int val; - asm volatile ("int $0x40":"=a"(val):"a"(51), "b"(1), "c"(proc), "d"(stack_top)); - return val; -} - -static inline -void kos_exit() -{ - asm volatile ("int $0x40"::"a"(-1)); -} - -static inline void focus_window(int slot){ - asm volatile ("int $0x40"::"a"(18), "b"(3), "c"(slot)); -} - -static inline int get_thread_slot(int tid){ - register int val; - asm volatile ("int $0x40":"=a"(val):"a"(18), "b"(21), "c"(tid)); - return val; -} - -static inline void set_current_folder(char* dir){ - asm volatile ("int $0x40"::"a"(30), "b"(1), "c"(dir)); -} - -static inline int get_current_folder(char* buf, int bufsize){ - register int val; - asm volatile ("int $0x40":"=a"(val):"a"(30), "b"(2), "c"(buf), "d"(bufsize)); - return val; -} - -static inline -void ipc_set_area(void* buf, int bufsize){ - asm volatile ("int $0x40"::"a"(60), "b"(1), "c"(buf), "d"(bufsize)); -} - -static inline -int ipc_send_message(int pid_reciever, void *data, int datalen) { - register int val; - asm volatile ("int $0x40":"=a"(val):"a"(60), "b"(2), "c"(pid_reciever), "d"(data), "S"(datalen)); - return val; -} - -static inline -void* shm_open(char *shm_name, int msize, int flags, int *retsz){ - register int val, cod; - asm volatile ("int $0x40":"=a"(val),"=d"(cod):"a"(68), "b"(22), "c"(shm_name), "d"(msize), "S"(flags)); - - if(retsz) *retsz = cod; // errcode if NULL or memsize when open - return (void*)val; -} - -static inline -void shm_close(char *shm_name){ - asm volatile ("int $0x40"::"a"(68), "b"(23), "c"(shm_name)); -} - -static inline -int start_app(char *app_name, char *args){ - register int val; - struct file_op_t - { - uint32_t fn; - uint32_t flags; - char* args; - uint32_t res1, res2; - char zero; - char* app_name __attribute__((packed)); - } file_op; - memset(&file_op, 0, sizeof(file_op)); - file_op.fn = 7; - file_op.args = args; - file_op.app_name = app_name; - - - asm volatile ("int $0x40":"=a"(val):"a"(70), "b"(&file_op)); - - return val; -} - -//added nonstatic inline because incomfortabre stepping in in debugger -void __attribute__ ((noinline)) debug_board_write_str(const char* str); -void __attribute__ ((noinline)) debug_board_printf(const char *format,...); - -/* copy body to only one project file -void __attribute__ ((noinline)) debug_board_write_str(const char* str){ - while(*str) - debug_board_write_byte(*str++); -} - -void __attribute__ ((noinline)) debug_board_printf(const char *format,...) -{ - va_list ap; - char log_board[300]; - - va_start (ap, format); - vsnprintf(log_board, sizeof log_board, format, ap); - va_end(ap); - debug_board_write_str(log_board); -} -*/ - -// TinyC don't support aliasing of static inline funcs, but support #define :) -#ifndef __TINYC__ -static inline void BeginDraw(void) __attribute__ ((alias ("begin_draw"))); -static inline void EndDraw(void) __attribute__ ((alias ("end_draw"))); -static inline void DrawWindow(int x, int y, int w, int h, const char *name, - color_t workcolor, uint32_t style) - __attribute__ ((alias ("sys_create_window"))); -static inline void DefineButton(void) __attribute__ ((alias ("define_button"))); -static inline void DrawLine(int xs, int ys, int xe, int ye, color_t color) - __attribute__ ((alias ("draw_line"))); -static inline void DrawBar(int x, int y, int w, int h, color_t color) - __attribute__ ((alias ("draw_bar"))); -static inline void DrawBitmap(void *bitmap, int x, int y, int w, int h) - __attribute__ ((alias ("draw_bitmap"))); -static inline uint32_t GetSkinHeight(void) __attribute__ ((alias ("get_skin_height"))); -static inline pos_t GetMousePos(int origin) __attribute__ ((alias ("get_mouse_pos"))); -static inline uint32_t GetMouseButtons(void) __attribute__ ((alias ("get_mouse_buttons"))); -static inline uint32_t GetMouseWheels(void) __attribute__ ((alias ("get_mouse_wheels"))); -static inline uint32_t LoadCursor(void *path, uint32_t flags) __attribute__ ((alias ("load_cursor"))); -static inline uint32_t SetCursor(uint32_t cursor) __attribute__ ((alias ("set_cursor"))); -static inline int DestroyCursor(uint32_t cursor) __attribute__ ((alias ("destroy_cursor"))); -static inline uint32_t GetOsEvent(void) __attribute__ ((alias ("get_os_event"))); -static inline void *UserAlloc(size_t size) __attribute__ ((alias ("user_alloc"))); -static inline int UserFree(void *mem) __attribute__ ((alias ("user_free"))); -static inline void* UserRealloc(void *mem, size_t size) __attribute__ ((alias ("user_realloc"))); -static inline int *UserUnmap(void *base, size_t offset, size_t size) __attribute__ ((alias ("user_unmap"))); -static inline ufile_t LoadFile(const char *path) __attribute__ ((alias ("load_file"))); -static inline void GetProcInfo(char *info) __attribute__ ((alias ("get_proc_info"))); -#else - #define BeginDraw begin_draw - #define EndDraw end_draw - #define DrawWindow sys_create_window - #define DefineButton define_button - #define DrawLine draw_line - #define DrawBar draw_bar - #define DrawBitmap draw_bitmap - #define GetSkinHeight get_skin_height - #define GetMousePos get_mouse_pos - #define GetMouseButtons get_mouse_buttons - #define GetMouseWheels get_mouse_wheels - #define LoadCursor load_cursor - #define SetCursor set_cursor - #define DestroyCursor destroy_cursor - #define GetOsEvent get_os_event - #define UserAlloc user_alloc - #define UserFree user_free - #define UserRealloc user_realloc - #define UserUnmap user_unmap - #define LoadFile load_file - #define GetProcInfo get_proc_info -#endif - -#ifdef __cplusplus -} -#endif - - -#endif - - - - - diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/network.h b/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/network.h deleted file mode 100644 index 3d2948c762..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/network.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __NETWORK_H -#define __NETWORK_H - -#include "kosnet/socket.h" - -#define EAI_ADDRFAMILY 1 -#define EAI_AGAIN 2 -#define EAI_BADFLAGS 3 -#define EAI_FAIL 4 -#define EAI_FAMILY 5 -#define EAI_MEMORY 6 -#define EAI_NONAME 8 -#define EAI_SERVICE 9 -#define EAI_SOCKTYPE 10 -#define EAI_BADHINTS 12 -#define EAI_PROTOCOL 13 -#define EAI_OVERFLOW 14 - -// Flags for addrinfo -#define AI_PASSIVE 1 -#define AI_CANONNAME 2 -#define AI_NUMERICHOST 4 -#define AI_NUMERICSERV 8 -#define AI_ADDRCONFIG 0x400 - -#pragma pack(push, 1) -struct ARP_entry{ -unsigned int IP; -unsigned char MAC[6]; -unsigned short status; -unsigned short TTL; -}; -#pragma pack(pop) - -#pragma pack(push, 1) -struct addrinfo { - int ai_flags; - int ai_family; - int ai_socktype; - int ai_protocol; - int ai_addrlen; - char *ai_canonname; - sockaddr *ai_addr; - struct addrinfo *ai_next; -}; -#pragma pack(pop) - -extern int load_network_obj(); -extern int (*inet_addr)(const char* hostname) __attribute__ ((stdcall)); -extern char* (*inet_ntoa)(int ip_addr) __attribute__ ((stdcall)); -extern int (*getaddrinfo)(const char* hostname, const char* servname, const struct addrinfo* hints, struct addrinfo** res) __attribute__ ((stdcall)); -extern void (*freeaddrinfo)(struct addrinfo* ai) __attribute__ ((stdcall)); - -#endif diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/socket.h b/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/socket.h deleted file mode 100644 index 344d2851a4..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/include/kosnet/socket.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef __SOCKET_H -#define __SOCKET_H - -#include - -// Socket Types -#define SOCK_STREAM 1 -#define SOCK_DGRAM 2 -#define SOCK_RAW 3 - -// IP protocols -#define IPPROTO_IP 0 -#define IPPROTO_ICMP 1 -#define IPPROTO_TCP 6 -#define IPPROTO_UDP 17 -#define IPPROTO_RAW 255 - -// IP options -#define IP_TTL 2 - -// Address families -#define AF_UNSPEC 0 -#define AF_LOCAL 1 -#define AF_INET4 2 // IPv4 -#define AF_INET6 10 // IPv6 - -#define PF_UNSPEC AF_UNSPEC -#define PF_LOCAL AF_LOCAL -#define PF_INET4 AF_INET4 -#define PF_INET6 AF_INET6 - -// internal definition -#define AI_SUPPORTED 0x40F - -// for system function 76 -#define API_ETH (0<<16) -#define API_IPv4 (1<<16) -#define API_ICMP (2<<16) -#define API_UDP (3<<16) -#define API_TCP (4<<16) -#define API_ARP (5<<16) -#define API_PPPOE (6<<16) - -// Socket flags for user calls -#define MSG_NOFLAG 0 -#define MSG_PEEK 0x02 -#define MSG_DONTWAIT 0x40 - -// Socket levels -#define SOL_SOCKET 0xffff - -//Socket options -#define SO_BINDTODEVICE (1<<9) -#define SO_NONBLOCK (1<<31) - -// Error Codes -#define ENOBUFS 1 -#define EINPROGRESS 2 -#define EOPNOTSUPP 4 -#define EWOULDBLOCK 6 -#define ENOTCONN 9 -#define EALREADY 10 -#define EINVALUE 11 -#define EMSGSIZE 12 -#define ENOMEM 18 -#define EADDRINUSE 20 -#define ECONNREFUSED 61 -#define ECONNRESET 52 -#define EISCONN 56 -#define ETIMEDOUT 60 -#define ECONNABORTED 53 - - -#define PORT(X) (X<<8) -extern int err_code; - -#pragma pack(push,1) -typedef struct{ - unsigned short sin_family; - unsigned short sin_port; - unsigned int sin_addr; - unsigned long long sin_zero; -}sockaddr; -#pragma pack(pop) - -#pragma pack(push,1) -typedef struct{ - unsigned int level; - unsigned int optionname; - unsigned int optlenght; - unsigned char options; -}optstruct; -#pragma pack(pop) - -int socket(int domain, int type, int protocol); -int closesocket(int socket); -int bind(int socket, const sockaddr *addres, int addres_len); -int listen(int socket, int backlog); -int connect(int socket, const sockaddr* address, int socket_len); -int accept(int socket, const sockaddr* address, int address_len); -int send(int socket, const void *message, size_t msg_len, int flag); -int recv(int socket, void *buffer, size_t buff_len, int flag); -int setsockopt(int socket,const optstruct* opt); -int getsockopt(int socket, optstruct* opt); -int socketpair(int *sock1, int *sock2); - -#endif diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/network.c b/programs/develop/libraries/kos_mbedtls/kosnet/network.c deleted file mode 100644 index 00efaec0b3..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/network.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "kosnet/network.h" -#include "kosnet/dlfcn.h" - -int (*inet_addr)(const char* hostname) __attribute__ ((stdcall)); -char* (*inet_ntoa)(int ip_addr) __attribute__ ((stdcall)); -int (*getaddrinfo)(const char* hostname, const char* servname, const struct addrinfo* hints, struct addrinfo** res) __attribute__ ((stdcall)); -void (*freeaddrinfo)(struct addrinfo* ai) __attribute__ ((stdcall)); - -int load_network_obj() { - void *network_lib = dlopen("/sys/lib/network.obj", RTLD_GLOBAL); - if (network_lib == NULL) { - return -1; - } - inet_addr = dlsym(network_lib, "inet_addr"); - inet_ntoa = dlsym(network_lib, "inet_ntoa"); - getaddrinfo = dlsym(network_lib, "getaddrinfo"); - freeaddrinfo = dlsym(network_lib, "freeaddrinfo"); - dlclose(network_lib); - return 0; -} - \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/sample/Makefile b/programs/develop/libraries/kos_mbedtls/kosnet/sample/Makefile deleted file mode 100644 index 192e9398be..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/sample/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -NEWLIB_INCLUDES=D:\KOSSDK\newlib\libc\include -APP_DYNAMIC_LDS=D:\KOSSDK\newlib/app-dynamic.lds -LIBDIR=D:\KOSSDK\kos32-msys-5.4.0\win32\lib -MAIN_TARGET=libkosnet_demo - -CC=kos32-gcc -LD=kos32-ld -OBJCOPY=kos32-objcopy - -CCFLAGS=-c -fomit-frame-pointer -I $(NEWLIB_INCLUDES) -I../include -Wall -Wextra -LDFLAGS=-call_shared -nostdlib --subsystem console -T $(APP_DYNAMIC_LDS) --image-base 0 -L $(LIBDIR) -L ../ -lkosnet -lgcc -lapp -lc.dll - -all: libkosnet_demo - -libkosnet_demo: libkosnet_demo.o - $(LD) libkosnet_demo.o -o $(MAIN_TARGET) $(LDFLAGS) - $(OBJCOPY) $(MAIN_TARGET) -O binary - -libkosnet_demo.o: libkosnet_demo.c - $(CC) $(CCFLAGS) libkosnet_demo.c -o libkosnet_demo.o - -clean: - del *.o - del $(MAIN_TARGET) \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/sample/libkosnet_demo b/programs/develop/libraries/kos_mbedtls/kosnet/sample/libkosnet_demo deleted file mode 100644 index 9cc0fa6cf5..0000000000 Binary files a/programs/develop/libraries/kos_mbedtls/kosnet/sample/libkosnet_demo and /dev/null differ diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/sample/libkosnet_demo.c b/programs/develop/libraries/kos_mbedtls/kosnet/sample/libkosnet_demo.c deleted file mode 100644 index 4d78417916..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/sample/libkosnet_demo.c +++ /dev/null @@ -1,60 +0,0 @@ -#include "kosnet/network.h" -#include -#include -#include - -int main() { - load_network_obj(); - - char *host = "kolibrios.org"; - int port = 80; - printf("Connecting to %s on port %d\n", host, port); - - struct addrinfo *addr_info; - char port_str[16]; sprintf(port_str, "%d", port); - struct addrinfo hints; - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; // IPv4 or IPv6 doesnt matter - hints.ai_socktype = SOCK_STREAM; // TCP stream sockets - if (getaddrinfo(host, port_str, 0, &addr_info) != 0) { - printf("Host %s not found!\n", host); - freeaddrinfo(addr_info); - exit(-1); - } - printf("IP address of %s is %s\n", host, inet_ntoa(addr_info->ai_addr->sin_addr)); - //printf("Host port = %d\n", addr_info->ai_addr->sin_port >> 8); - - char request[256]; - sprintf(request, "GET /en/ HTTP/1.1\r\nHost: %s\r\n\r\n", host); - printf("request = %s\n", request); - - int sock = socket(AF_INET4, SOCK_STREAM, IPPROTO_TCP); - - puts("Connecting...\n"); - if (connect(sock, addr_info->ai_addr, addr_info->ai_addrlen) != 0) { - printf("Connection failed, err_code = %d\n", err_code); - exit(err_code); - } - puts("Connected successfully\n"); - - puts("Sending request...\n"); - if (send(sock, request, strlen(request), MSG_NOFLAG) == -1) { - printf("Sending failed, err_code = %d\n", err_code); - exit(err_code); - } - puts("Request sended successfully, waiting for response...\n"); - - char buf[512 + 1]; - if (recv(sock, buf, 512, MSG_NOFLAG) == -1) { - printf("Receive failed, err_code = %d\n", err_code); - exit(err_code); - } - - printf("Response = %s\n", buf); - - freeaddrinfo(addr_info); - - closesocket(sock); - puts("\n goodbye)\n"); - return 0; -} \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/sample/run_img.bat b/programs/develop/libraries/kos_mbedtls/kosnet/sample/run_img.bat deleted file mode 100644 index acc38af55a..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/sample/run_img.bat +++ /dev/null @@ -1 +0,0 @@ -qemu-system-i386 -m 256 -fda ../../test_kos_images/kolibri.img -boot a -vga vmware -net nic,model=rtl8139 -net user -soundhw ac97 -usb -usbdevice tablet -drive file=fat:rw:. \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/kosnet/socket.c b/programs/develop/libraries/kos_mbedtls/kosnet/socket.c deleted file mode 100644 index 2131bc55a3..0000000000 --- a/programs/develop/libraries/kos_mbedtls/kosnet/socket.c +++ /dev/null @@ -1,124 +0,0 @@ -#include "kosnet/socket.h" - -int err_code = 0; - -int socket(int domain, int type, int protocol) -{ - int socket; - asm volatile( - "int $0x40" - :"=b"(err_code), "=a"(socket) - :"a"(75), "b"(0), "c"(domain), "d"(type), "S"(protocol) - ); - return socket; -} - -int closesocket(int socket) -{ - int status; - asm volatile( - "int $0x40" - :"=b"(err_code), "=a"(status) - :"a"(75), "b"(1), "c"(socket) - ); - return status; -} - -int bind(int socket, const sockaddr *addres, int addres_len) -{ - int status; - asm volatile( - "int $0x40" - :"=b"(err_code), "=a"(status) - :"a"(75), "b"(2), "c"(socket), "d"(addres), "S"(addres_len) - ); - return status; -} - -int listen(int socket, int backlog) -{ - int status; - asm volatile( - "int $0x40" - :"=b"(err_code), "=a"(status) - :"a"(75), "b"(3), "c"(socket), "d"(backlog) - ); - return status; -} - -int connect(int socket,const sockaddr* address, int socket_len) -{ - int status; - asm volatile( - "int $0x40" - :"=b"(err_code), "=a"(status) - :"a"(75), "b"(4), "c"(socket), "d"(address), "S"(socket_len) - ); - return status; -} - -int accept(int socket, const sockaddr *address, int address_len) -{ - int new_socket; - asm volatile( - "int $0x40" - :"=b"(err_code), "=a"(new_socket) - :"a"(75), "b"(5), "c"(socket), "d"(address), "S"(address_len) - ); - return new_socket; -} - -int send(int socket, const void *message, size_t msg_len, int flag) -{ - int status; - asm volatile( - "int $0x40" - :"=b"(err_code), "=a"(status) - :"a"(75), "b"(6), "c"(socket), "d"(message), "S"(msg_len), "D"(flag) - ); - return status; -} - -int recv(int socket, void *buffer, size_t buff_len, int flag) -{ - int status; - asm volatile( - "int $0x40" - :"=b"(err_code), "=a"(status) - :"a"(75), "b"(7), "c"(socket), "d"(buffer), "S"(buff_len), "D"(flag) - ); - return status; -} - -int setsockopt(int socket,const optstruct* opt) -{ - int status; - asm volatile( - "int $0x40" - :"=b"(err_code), "=a"(status) - :"a"(75), "b"(8), "c"(socket),"d"(opt) - ); - return status; -} - -int getsockopt(int socket, optstruct* opt) -{ - int status; - asm volatile( - "int $0x40" - :"=b"(err_code), "=a"(status) - :"a"(75), "b"(9), "c"(socket),"d"(opt) - ); - return status; -} - -int socketpair(int *socket1, int *socket2) -{ - asm volatile( - "int $0x40" - :"=b"(*socket2), "=a"(*socket1) - :"a"(75), "b"(10) - ); - err_code=*socket2; - return *socket1; -} \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/library/.gitignore b/programs/develop/libraries/kos_mbedtls/library/.gitignore deleted file mode 100644 index 5761abcfdf..0000000000 --- a/programs/develop/libraries/kos_mbedtls/library/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.o diff --git a/programs/develop/libraries/kos_mbedtls/library/CMakeLists.txt b/programs/develop/libraries/kos_mbedtls/library/CMakeLists.txt deleted file mode 100644 index 93ce7b8f44..0000000000 --- a/programs/develop/libraries/kos_mbedtls/library/CMakeLists.txt +++ /dev/null @@ -1,187 +0,0 @@ -option(USE_STATIC_MBEDTLS_LIBRARY "Build mbed TLS static library." ON) -option(USE_SHARED_MBEDTLS_LIBRARY "Build mbed TLS shared library." OFF) -option(LINK_WITH_PTHREAD "Explicitly link mbed TLS library to pthread." OFF) - -set(src_crypto - aes.c - aesni.c - arc4.c - aria.c - asn1parse.c - asn1write.c - base64.c - bignum.c - blowfish.c - camellia.c - ccm.c - chacha20.c - chachapoly.c - cipher.c - cipher_wrap.c - cmac.c - ctr_drbg.c - des.c - dhm.c - ecdh.c - ecdsa.c - ecjpake.c - ecp.c - ecp_curves.c - entropy.c - entropy_poll.c - error.c - gcm.c - havege.c - hkdf.c - hmac_drbg.c - md.c - md2.c - md4.c - md5.c - md_wrap.c - memory_buffer_alloc.c - nist_kw.c - oid.c - padlock.c - pem.c - pk.c - pk_wrap.c - pkcs12.c - pkcs5.c - pkparse.c - pkwrite.c - platform.c - platform_util.c - poly1305.c - ripemd160.c - rsa.c - rsa_internal.c - sha1.c - sha256.c - sha512.c - threading.c - timing.c - version.c - version_features.c - xtea.c -) - -set(src_x509 - certs.c - pkcs11.c - x509.c - x509_create.c - x509_crl.c - x509_crt.c - x509_csr.c - x509write_crt.c - x509write_csr.c -) - -set(src_tls - debug.c - net_sockets.c - ssl_cache.c - ssl_ciphersuites.c - ssl_cli.c - ssl_cookie.c - ssl_srv.c - ssl_ticket.c - ssl_tls.c -) - -if(CMAKE_COMPILER_IS_GNUCC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes") -endif(CMAKE_COMPILER_IS_GNUCC) - -if(CMAKE_COMPILER_IS_CLANG) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code") -endif(CMAKE_COMPILER_IS_CLANG) - -if(UNSAFE_BUILD) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error") - set(CMAKE_C_FLAGS_ASAN "${CMAKE_C_FLAGS_ASAN} -Wno-error") - set(CMAKE_C_FLAGS_ASANDBG "${CMAKE_C_FLAGS_ASANDBG} -Wno-error") -endif(UNSAFE_BUILD) - -if(WIN32) - set(libs ${libs} ws2_32) -endif(WIN32) - -if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - SET(CMAKE_C_ARCHIVE_CREATE " Scr ") - SET(CMAKE_CXX_ARCHIVE_CREATE " Scr ") - SET(CMAKE_C_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") - SET(CMAKE_CXX_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") -endif() - -if(HAIKU) - set(libs ${libs} network) -endif(HAIKU) - -if(USE_PKCS11_HELPER_LIBRARY) - set(libs ${libs} pkcs11-helper) -endif(USE_PKCS11_HELPER_LIBRARY) - -if(ENABLE_ZLIB_SUPPORT) - set(libs ${libs} ${ZLIB_LIBRARIES}) -endif(ENABLE_ZLIB_SUPPORT) - -if(LINK_WITH_PTHREAD) - set(libs ${libs} pthread) -endif() - -if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY) - message(FATAL_ERROR "Need to choose static or shared mbedtls build!") -endif(NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY) - -if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY) - set(mbedtls_static_target "mbedtls_static") - set(mbedx509_static_target "mbedx509_static") - set(mbedcrypto_static_target "mbedcrypto_static") -elseif(USE_STATIC_MBEDTLS_LIBRARY) - set(mbedtls_static_target "mbedtls") - set(mbedx509_static_target "mbedx509") - set(mbedcrypto_static_target "mbedcrypto") -endif() - -if(USE_STATIC_MBEDTLS_LIBRARY) - add_library(${mbedcrypto_static_target} STATIC ${src_crypto}) - set_target_properties(${mbedcrypto_static_target} PROPERTIES OUTPUT_NAME mbedcrypto) - target_link_libraries(${mbedcrypto_static_target} ${libs}) - - add_library(${mbedx509_static_target} STATIC ${src_x509}) - set_target_properties(${mbedx509_static_target} PROPERTIES OUTPUT_NAME mbedx509) - target_link_libraries(${mbedx509_static_target} ${libs} ${mbedcrypto_static_target}) - - add_library(${mbedtls_static_target} STATIC ${src_tls}) - set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls) - target_link_libraries(${mbedtls_static_target} ${libs} ${mbedx509_static_target}) - - install(TARGETS ${mbedtls_static_target} ${mbedx509_static_target} ${mbedcrypto_static_target} - DESTINATION ${LIB_INSTALL_DIR} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -endif(USE_STATIC_MBEDTLS_LIBRARY) - -if(USE_SHARED_MBEDTLS_LIBRARY) - add_library(mbedcrypto SHARED ${src_crypto}) - set_target_properties(mbedcrypto PROPERTIES VERSION 2.16.6 SOVERSION 3) - target_link_libraries(mbedcrypto ${libs}) - - add_library(mbedx509 SHARED ${src_x509}) - set_target_properties(mbedx509 PROPERTIES VERSION 2.16.6 SOVERSION 0) - target_link_libraries(mbedx509 ${libs} mbedcrypto) - - add_library(mbedtls SHARED ${src_tls}) - set_target_properties(mbedtls PROPERTIES VERSION 2.16.6 SOVERSION 12) - target_link_libraries(mbedtls ${libs} mbedx509) - - install(TARGETS mbedtls mbedx509 mbedcrypto - DESTINATION ${LIB_INSTALL_DIR} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -endif(USE_SHARED_MBEDTLS_LIBRARY) - -add_custom_target(lib DEPENDS mbedcrypto mbedx509 mbedtls) -if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY) - add_dependencies(lib mbedcrypto_static mbedx509_static mbedtls_static) -endif() diff --git a/programs/develop/libraries/kos_mbedtls/library/Makefile b/programs/develop/libraries/kos_mbedtls/library/Makefile index 05bb47747c..b97b318065 100644 --- a/programs/develop/libraries/kos_mbedtls/library/Makefile +++ b/programs/develop/libraries/kos_mbedtls/library/Makefile @@ -1,28 +1,12 @@ -# Also see "include/mbedtls/config.h" - -NEWLIB_INCLUDES=D:\KOSSDK\newlib\libc\include -KOSNET_INCLUDES=../kosnet/include - CC = kos32-gcc -AR = kos32-ar +FASM = fasm +CLINK= ../../../clink/clink -CFLAGS ?= -O2 -WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -LDFLAGS ?= +KLIBC_DIR = ../../../ktcc/trunk/libc.obj -LOCAL_CFLAGS = $(WARNING_CFLAGS) -I $(NEWLIB_INCLUDES) -I../include -I $(KOSNET_INCLUDES) -D_FILE_OFFSET_BITS=64 -LOCAL_LDFLAGS = - -ifdef DEBUG -LOCAL_CFLAGS += -g3 -endif - -# Set AR_DASH= (empty string) to use an ar implementation that does not accept -# the - prefix for command line options (e.g. llvm-ar) -AR_DASH ?= - - -ARFLAGS = $(AR_DASH)src +CFLAGS = -c -nostdinc -I../include -DGNUC -fno-common -Os -fno-delete-null-pointer-checks -fno-ident -fno-builtin -fno-leading-underscore -D__TINYC__ -D_FILE_OFFSET_BITS=64 +INCLUDES = -I../include -I.. -I$(KLIBC_DIR)/include OBJS_CRYPTO= aes.o aesni.o arc4.o \ aria.o asn1parse.o asn1write.o \ @@ -55,38 +39,27 @@ OBJS_TLS= debug.o net_sockets.o \ ssl_cache.o ssl_ciphersuites.o \ ssl_cli.o ssl_cookie.o \ ssl_srv.o ssl_ticket.o \ - ssl_tls.o + ssl_tls.o + +OBJS_OTHER = libtcc/libtcc1.o libtcc/memmove.o \ + libtcc/memset.o libtcc/memcpy.o \ + libtcc/___chkstk_ms.o \ + mbedtls_init.o \ + export.o + +all: $(OBJS_CRYPTO) $(OBJS_TLS) $(OBJS_X509) $(OBJS_OTHER) + ar -crs libmbedtls.a $(OBJS_CRYPTO) $(OBJS_TLS) $(OBJS_X509) $(OBJS_OTHER) + $(CLINK) $(OBJS_CRYPTO) $(OBJS_TLS) $(OBJS_X509) $(OBJS_OTHER) > clink.log + mv -f a.out.obj mbedtls.obj + strip --strip-unneeded -x mbedtls.obj + kpack mbedtls.obj + cp -f mbedtls.obj /home/max/.kex/root/RD/1/LIB -.SILENT: +%.o : %.c Makefile + $(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $< + +%.o : %.asm Makefile + $(FASM) $< $@ -.PHONY: all static clean - -all: static - -static: libmbedcrypto.a libmbedx509.a libmbedtls.a - -# tls -libmbedtls.a: $(OBJS_TLS) - echo " AR $@" - $(AR) $(ARFLAGS) $@ $(OBJS_TLS) - -# x509 -libmbedx509.a: $(OBJS_X509) - echo " AR $@" - $(AR) $(ARFLAGS) $@ $(OBJS_X509) - -# crypto -libmbedcrypto.a: $(OBJS_CRYPTO) - echo " AR $@" - $(AR) $(ARFLAGS) $@ $(OBJS_CRYPTO) - -.c.o: - echo " CC $<" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $< - -clean: -ifndef WINDOWS - rm -f *.o libmbed* -else - del /Q /F *.o libmbed* -endif +clean: + rm -f $(OBJS_CRYPTO) $(OBJS_TLS) $(OBJS_X509) $(OBJS_LIBC) $(OBJS_OTHER) diff --git a/programs/develop/libraries/kos_mbedtls/library/export.asm b/programs/develop/libraries/kos_mbedtls/library/export.asm new file mode 100644 index 0000000000..c52e60909c --- /dev/null +++ b/programs/develop/libraries/kos_mbedtls/library/export.asm @@ -0,0 +1,1514 @@ +format coff +use32 + +public @EXPORT as 'EXPORTS' + +section '.text' + +include '../../../../proc32.inc' +include '../../../../macros.inc' +include '../../../../debug-fdo.inc' +include '../../../../dll.inc' + +extrn mbedtls_aes_crypt_cbc +extrn mbedtls_aes_crypt_cfb128 +extrn mbedtls_aes_crypt_cfb8 +extrn mbedtls_aes_crypt_ctr +extrn mbedtls_aes_crypt_ecb +extrn mbedtls_aes_crypt_ofb +extrn mbedtls_aes_crypt_xts +extrn mbedtls_aes_decrypt +extrn mbedtls_aes_encrypt +extrn mbedtls_aes_free +extrn mbedtls_aes_init +extrn mbedtls_aes_self_test +extrn mbedtls_aes_setkey_dec +extrn mbedtls_aes_setkey_enc +extrn mbedtls_aes_xts_free +extrn mbedtls_aes_xts_init +extrn mbedtls_aes_xts_setkey_dec +extrn mbedtls_aes_xts_setkey_enc +extrn mbedtls_arc4_crypt +extrn mbedtls_arc4_free +extrn mbedtls_arc4_init +extrn mbedtls_arc4_self_test +extrn mbedtls_arc4_setup +extrn mbedtls_asn1_find_named_data +extrn mbedtls_asn1_free_named_data +extrn mbedtls_asn1_free_named_data_list +extrn mbedtls_asn1_get_alg +extrn mbedtls_asn1_get_alg_null +extrn mbedtls_asn1_get_bitstring +extrn mbedtls_asn1_get_bitstring_null +extrn mbedtls_asn1_get_bool +extrn mbedtls_asn1_get_int +extrn mbedtls_asn1_get_len +extrn mbedtls_asn1_get_mpi +extrn mbedtls_asn1_get_sequence_of +extrn mbedtls_asn1_get_tag +extrn mbedtls_asn1_store_named_data +extrn mbedtls_asn1_write_algorithm_identifier +extrn mbedtls_asn1_write_bitstring +extrn mbedtls_asn1_write_bool +extrn mbedtls_asn1_write_ia5_string +extrn mbedtls_asn1_write_int +extrn mbedtls_asn1_write_len +extrn mbedtls_asn1_write_mpi +extrn mbedtls_asn1_write_null +extrn mbedtls_asn1_write_octet_string +extrn mbedtls_asn1_write_oid +extrn mbedtls_asn1_write_printable_string +extrn mbedtls_asn1_write_raw_buffer +extrn mbedtls_asn1_write_tag +extrn mbedtls_asn1_write_tagged_string +extrn mbedtls_asn1_write_utf8_string +extrn mbedtls_base64_decode +extrn mbedtls_base64_encode +extrn mbedtls_base64_self_test +extrn mbedtls_blowfish_crypt_cbc +extrn mbedtls_blowfish_crypt_cfb64 +extrn mbedtls_blowfish_crypt_ctr +extrn mbedtls_blowfish_crypt_ecb +extrn mbedtls_blowfish_free +extrn mbedtls_blowfish_init +extrn mbedtls_blowfish_setkey +extrn mbedtls_camellia_crypt_cbc +extrn mbedtls_camellia_crypt_cfb128 +extrn mbedtls_camellia_crypt_ctr +extrn mbedtls_camellia_crypt_ecb +extrn mbedtls_camellia_free +extrn mbedtls_camellia_init +extrn mbedtls_camellia_self_test +extrn mbedtls_camellia_setkey_dec +extrn mbedtls_camellia_setkey_enc +extrn mbedtls_ccm_auth_decrypt +extrn mbedtls_ccm_encrypt_and_tag +extrn mbedtls_ccm_free +extrn mbedtls_ccm_init +extrn mbedtls_ccm_self_test +extrn mbedtls_ccm_setkey +extrn mbedtls_ccm_star_auth_decrypt +extrn mbedtls_ccm_star_encrypt_and_tag +extrn mbedtls_chacha20_crypt +extrn mbedtls_chacha20_free +extrn mbedtls_chacha20_init +extrn mbedtls_chacha20_self_test +extrn mbedtls_chacha20_setkey +extrn mbedtls_chacha20_starts +extrn mbedtls_chacha20_update +extrn mbedtls_chachapoly_auth_decrypt +extrn mbedtls_chachapoly_encrypt_and_tag +extrn mbedtls_chachapoly_finish +extrn mbedtls_chachapoly_free +extrn mbedtls_chachapoly_init +extrn mbedtls_chachapoly_self_test +extrn mbedtls_chachapoly_setkey +extrn mbedtls_chachapoly_starts +extrn mbedtls_chachapoly_update +extrn mbedtls_chachapoly_update_aad +extrn mbedtls_cipher_auth_decrypt +extrn mbedtls_cipher_auth_encrypt +extrn mbedtls_cipher_check_tag +extrn mbedtls_cipher_crypt +extrn mbedtls_cipher_finish +extrn mbedtls_cipher_free +extrn mbedtls_cipher_info_from_string +extrn mbedtls_cipher_info_from_type +extrn mbedtls_cipher_info_from_values +extrn mbedtls_cipher_init +extrn mbedtls_cipher_list +extrn mbedtls_cipher_reset +extrn mbedtls_cipher_set_iv +extrn mbedtls_cipher_setkey +extrn mbedtls_cipher_set_padding_mode +extrn mbedtls_cipher_setup +extrn mbedtls_cipher_update +extrn mbedtls_cipher_update_ad +extrn mbedtls_cipher_write_tag +extrn mbedtls_ctr_drbg_free +extrn mbedtls_ctr_drbg_init +extrn mbedtls_ctr_drbg_random +extrn mbedtls_ctr_drbg_random_with_add +extrn mbedtls_ctr_drbg_reseed +extrn mbedtls_ctr_drbg_seed +extrn mbedtls_ctr_drbg_seed_entropy_len +extrn mbedtls_ctr_drbg_self_test +extrn mbedtls_ctr_drbg_set_entropy_len +extrn mbedtls_ctr_drbg_set_prediction_resistance +extrn mbedtls_ctr_drbg_set_reseed_interval +extrn mbedtls_ctr_drbg_update +extrn mbedtls_ctr_drbg_update_ret +extrn mbedtls_debug_print_buf +extrn mbedtls_debug_print_crt +extrn mbedtls_debug_print_ecp +extrn mbedtls_debug_printf_ecdh +extrn mbedtls_debug_print_mpi +extrn mbedtls_debug_print_msg +extrn mbedtls_debug_print_ret +extrn mbedtls_debug_set_threshold +extrn mbedtls_des3_crypt_cbc +extrn mbedtls_des3_crypt_ecb +extrn mbedtls_des3_free +extrn mbedtls_des3_init +extrn mbedtls_des3_set2key_dec +extrn mbedtls_des3_set2key_enc +extrn mbedtls_des3_set3key_dec +extrn mbedtls_des3_set3key_enc +extrn mbedtls_des_crypt_cbc +extrn mbedtls_des_crypt_ecb +extrn mbedtls_des_free +extrn mbedtls_des_init +extrn mbedtls_des_key_check_key_parity +extrn mbedtls_des_key_check_weak +extrn mbedtls_des_key_set_parity +extrn mbedtls_des_self_test +extrn mbedtls_des_setkey +extrn mbedtls_des_setkey_dec +extrn mbedtls_des_setkey_enc +extrn mbedtls_dhm_calc_secret +extrn mbedtls_dhm_free +extrn mbedtls_dhm_init +extrn mbedtls_dhm_make_params +extrn mbedtls_dhm_make_public +extrn mbedtls_dhm_parse_dhm +extrn mbedtls_dhm_read_params +extrn mbedtls_dhm_read_public +extrn mbedtls_dhm_self_test +extrn mbedtls_dhm_set_group +extrn mbedtls_ecdh_calc_secret +extrn mbedtls_ecdh_compute_shared +extrn mbedtls_ecdh_free +extrn mbedtls_ecdh_gen_public +extrn mbedtls_ecdh_get_params +extrn mbedtls_ecdh_init +extrn mbedtls_ecdh_make_params +extrn mbedtls_ecdh_make_public +extrn mbedtls_ecdh_read_params +extrn mbedtls_ecdh_read_public +extrn mbedtls_ecdh_setup +extrn mbedtls_ecdsa_free +extrn mbedtls_ecdsa_from_keypair +extrn mbedtls_ecdsa_genkey +extrn mbedtls_ecdsa_init +extrn mbedtls_ecdsa_read_signature +extrn mbedtls_ecdsa_read_signature_restartable +extrn mbedtls_ecdsa_sign +extrn mbedtls_ecdsa_sign_det +extrn mbedtls_ecdsa_sign_det_ext +extrn mbedtls_ecdsa_verify +extrn mbedtls_ecdsa_write_signature +extrn mbedtls_ecdsa_write_signature_det +extrn mbedtls_ecdsa_write_signature_restartable +extrn mbedtls_ecp_check_privkey +extrn mbedtls_ecp_check_pubkey +extrn mbedtls_ecp_check_pub_priv +extrn mbedtls_ecp_copy +extrn mbedtls_ecp_curve_info_from_grp_id +extrn mbedtls_ecp_curve_info_from_name +extrn mbedtls_ecp_curve_info_from_tls_id +extrn mbedtls_ecp_curve_list +extrn mbedtls_ecp_gen_key +extrn mbedtls_ecp_gen_keypair +extrn mbedtls_ecp_gen_keypair_base +extrn mbedtls_ecp_gen_privkey +extrn mbedtls_ecp_group_copy +extrn mbedtls_ecp_group_free +extrn mbedtls_ecp_group_init +extrn mbedtls_ecp_group_load +extrn mbedtls_ecp_grp_id_list +extrn mbedtls_ecp_is_zero +extrn mbedtls_ecp_keypair_free +extrn mbedtls_ecp_keypair_init +extrn mbedtls_ecp_mul +extrn mbedtls_ecp_muladd +extrn mbedtls_ecp_muladd_restartable +extrn mbedtls_ecp_mul_restartable +extrn mbedtls_ecp_point_cmp +extrn mbedtls_ecp_point_free +extrn mbedtls_ecp_point_init +extrn mbedtls_ecp_point_read_binary +extrn mbedtls_ecp_point_read_string +extrn mbedtls_ecp_point_write_binary +extrn mbedtls_ecp_self_test +extrn mbedtls_ecp_set_zero +extrn mbedtls_ecp_tls_read_group +extrn mbedtls_ecp_tls_read_group_id +extrn mbedtls_ecp_tls_read_point +extrn mbedtls_ecp_tls_write_group +extrn mbedtls_ecp_tls_write_point +extrn mbedtls_entropy_add_source +extrn mbedtls_entropy_free +extrn mbedtls_entropy_func +extrn mbedtls_entropy_gather +extrn mbedtls_entropy_init +extrn mbedtls_entropy_self_test +extrn mbedtls_entropy_update_manual +extrn mbedtls_gcm_auth_decrypt +extrn mbedtls_gcm_crypt_and_tag +extrn mbedtls_gcm_finish +extrn mbedtls_gcm_free +extrn mbedtls_gcm_init +extrn mbedtls_gcm_self_test +extrn mbedtls_gcm_setkey +extrn mbedtls_gcm_starts +extrn mbedtls_gcm_update +extrn mbedtls_hkdf +extrn mbedtls_hkdf_expand +extrn mbedtls_hkdf_extract +extrn mbedtls_hmac_drbg_free +extrn mbedtls_hmac_drbg_init +extrn mbedtls_hmac_drbg_random +extrn mbedtls_hmac_drbg_random_with_add +extrn mbedtls_hmac_drbg_reseed +extrn mbedtls_hmac_drbg_seed +extrn mbedtls_hmac_drbg_seed_buf +extrn mbedtls_hmac_drbg_self_test +extrn mbedtls_hmac_drbg_set_entropy_len +extrn mbedtls_hmac_drbg_set_prediction_resistance +extrn mbedtls_hmac_drbg_set_reseed_interval +extrn mbedtls_hmac_drbg_update +extrn mbedtls_hmac_drbg_update_ret +extrn mbedtls_init +extrn mbedtls_internal_aes_decrypt +extrn mbedtls_internal_aes_encrypt +extrn mbedtls_internal_md5_process +extrn mbedtls_internal_ripemd160_process +extrn mbedtls_internal_sha1_process +extrn mbedtls_internal_sha256_process +extrn mbedtls_internal_sha512_process +extrn mbedtls_md +extrn mbedtls_md5 +extrn mbedtls_md5_clone +extrn mbedtls_md5_finish +extrn mbedtls_md5_finish_ret +extrn mbedtls_md5_free +extrn mbedtls_md5_init +extrn mbedtls_md5_process +extrn mbedtls_md5_ret +extrn mbedtls_md5_self_test +extrn mbedtls_md5_starts +extrn mbedtls_md5_starts_ret +extrn mbedtls_md5_update +extrn mbedtls_md5_update_ret +extrn mbedtls_md_clone +extrn mbedtls_md_finish +extrn mbedtls_md_free +extrn mbedtls_md_get_name +extrn mbedtls_md_get_size +extrn mbedtls_md_get_type +extrn mbedtls_md_hmac +extrn mbedtls_md_hmac_finish +extrn mbedtls_md_hmac_reset +extrn mbedtls_md_hmac_starts +extrn mbedtls_md_hmac_update +extrn mbedtls_md_info_from_string +extrn mbedtls_md_info_from_type +extrn mbedtls_md_init +extrn mbedtls_md_init_ctx +extrn mbedtls_md_list +extrn mbedtls_md_process +extrn mbedtls_md_setup +extrn mbedtls_md_starts +extrn mbedtls_md_update +extrn mbedtls_mpi_add_abs +extrn mbedtls_mpi_add_int +extrn mbedtls_mpi_add_mpi +extrn mbedtls_mpi_bitlen +extrn mbedtls_mpi_cmp_abs +extrn mbedtls_mpi_cmp_int +extrn mbedtls_mpi_cmp_mpi +extrn mbedtls_mpi_copy +extrn mbedtls_mpi_div_int +extrn mbedtls_mpi_div_mpi +extrn mbedtls_mpi_exp_mod +extrn mbedtls_mpi_fill_random +extrn mbedtls_mpi_free +extrn mbedtls_mpi_gcd +extrn mbedtls_mpi_gen_prime +extrn mbedtls_mpi_get_bit +extrn mbedtls_mpi_grow +extrn mbedtls_mpi_init +extrn mbedtls_mpi_inv_mod +extrn mbedtls_mpi_is_prime +extrn mbedtls_mpi_is_prime_ext +extrn mbedtls_mpi_lsb +extrn mbedtls_mpi_lset +extrn mbedtls_mpi_lt_mpi_ct +extrn mbedtls_mpi_mod_int +extrn mbedtls_mpi_mod_mpi +extrn mbedtls_mpi_mul_int +extrn mbedtls_mpi_mul_mpi +extrn mbedtls_mpi_read_binary +extrn mbedtls_mpi_read_string +extrn mbedtls_mpi_safe_cond_assign +extrn mbedtls_mpi_safe_cond_swap +extrn mbedtls_mpi_self_test +extrn mbedtls_mpi_set_bit +extrn mbedtls_mpi_shift_l +extrn mbedtls_mpi_shift_r +extrn mbedtls_mpi_shrink +extrn mbedtls_mpi_size +extrn mbedtls_mpi_sub_abs +extrn mbedtls_mpi_sub_int +extrn mbedtls_mpi_sub_mpi +extrn mbedtls_mpi_swap +extrn mbedtls_mpi_write_binary +extrn mbedtls_mpi_write_string +extrn mbedtls_net_connect +extrn mbedtls_net_free +extrn mbedtls_net_init +extrn mbedtls_net_recv +extrn mbedtls_net_send +extrn mbedtls_oid_get_attr_short_name +extrn mbedtls_oid_get_cipher_alg +extrn mbedtls_oid_get_ec_grp +extrn mbedtls_oid_get_extended_key_usage +extrn mbedtls_oid_get_md_alg +extrn mbedtls_oid_get_md_hmac +extrn mbedtls_oid_get_numeric_string +extrn mbedtls_oid_get_oid_by_ec_grp +extrn mbedtls_oid_get_oid_by_md +extrn mbedtls_oid_get_oid_by_pk_alg +extrn mbedtls_oid_get_oid_by_sig_alg +extrn mbedtls_oid_get_pk_alg +extrn mbedtls_oid_get_pkcs12_pbe_alg +extrn mbedtls_oid_get_sig_alg +extrn mbedtls_oid_get_sig_alg_desc +extrn mbedtls_oid_get_x509_ext_type +extrn mbedtls_padlock_has_support +extrn mbedtls_padlock_xcryptcbc +extrn mbedtls_padlock_xcryptecb +extrn mbedtls_pem_free +extrn mbedtls_pem_init +extrn mbedtls_pem_read_buffer +extrn mbedtls_pem_write_buffer +extrn mbedtls_pk_can_do +extrn mbedtls_pk_check_pair +extrn mbedtls_pkcs12_derivation +extrn mbedtls_pkcs12_pbe +extrn mbedtls_pkcs12_pbe_sha1_rc4_128 +extrn mbedtls_pkcs5_pbes2 +extrn mbedtls_pkcs5_pbkdf2_hmac +extrn mbedtls_pkcs5_self_test +extrn mbedtls_pk_debug +extrn mbedtls_pk_decrypt +extrn mbedtls_pk_encrypt +extrn mbedtls_pk_free +extrn mbedtls_pk_get_bitlen +extrn mbedtls_pk_get_name +extrn mbedtls_pk_get_type +extrn mbedtls_pk_info_from_type +extrn mbedtls_pk_init +extrn mbedtls_pk_parse_key +extrn mbedtls_pk_parse_public_key +extrn mbedtls_pk_parse_subpubkey +extrn mbedtls_pk_setup +extrn mbedtls_pk_setup_rsa_alt +extrn mbedtls_pk_sign +extrn mbedtls_pk_sign_restartable +extrn mbedtls_pk_verify +extrn mbedtls_pk_verify_ext +extrn mbedtls_pk_verify_restartable +extrn mbedtls_pk_write_key_der +extrn mbedtls_pk_write_key_pem +extrn mbedtls_pk_write_pubkey +extrn mbedtls_pk_write_pubkey_der +extrn mbedtls_pk_write_pubkey_pem +extrn mbedtls_platform_gmtime_r +extrn mbedtls_platform_setup +extrn mbedtls_platform_teardown +extrn mbedtls_platform_zeroize +extrn mbedtls_poly1305_finish +extrn mbedtls_poly1305_free +extrn mbedtls_poly1305_init +extrn mbedtls_poly1305_mac +extrn mbedtls_poly1305_self_test +extrn mbedtls_poly1305_starts +extrn mbedtls_poly1305_update +extrn mbedtls_ripemd160 +extrn mbedtls_ripemd160_clone +extrn mbedtls_ripemd160_finish +extrn mbedtls_ripemd160_finish_ret +extrn mbedtls_ripemd160_free +extrn mbedtls_ripemd160_init +extrn mbedtls_ripemd160_process +extrn mbedtls_ripemd160_ret +extrn mbedtls_ripemd160_self_test +extrn mbedtls_ripemd160_starts +extrn mbedtls_ripemd160_starts_ret +extrn mbedtls_ripemd160_update +extrn mbedtls_ripemd160_update_ret +extrn mbedtls_rsa_check_privkey +extrn mbedtls_rsa_check_pubkey +extrn mbedtls_rsa_check_pub_priv +extrn mbedtls_rsa_complete +extrn mbedtls_rsa_copy +extrn mbedtls_rsa_deduce_crt +extrn mbedtls_rsa_deduce_primes +extrn mbedtls_rsa_deduce_private_exponent +extrn mbedtls_rsa_export +extrn mbedtls_rsa_export_crt +extrn mbedtls_rsa_export_raw +extrn mbedtls_rsa_free +extrn mbedtls_rsa_gen_key +extrn mbedtls_rsa_get_len +extrn mbedtls_rsa_import +extrn mbedtls_rsa_import_raw +extrn mbedtls_rsa_init +extrn mbedtls_rsa_pkcs1_decrypt +extrn mbedtls_rsa_pkcs1_encrypt +extrn mbedtls_rsa_pkcs1_sign +extrn mbedtls_rsa_pkcs1_verify +extrn mbedtls_rsa_private +extrn mbedtls_rsa_public +extrn mbedtls_rsa_rsaes_oaep_decrypt +extrn mbedtls_rsa_rsaes_oaep_encrypt +extrn mbedtls_rsa_rsaes_pkcs1_v15_decrypt +extrn mbedtls_rsa_rsaes_pkcs1_v15_encrypt +extrn mbedtls_rsa_rsassa_pkcs1_v15_sign +extrn mbedtls_rsa_rsassa_pkcs1_v15_verify +extrn mbedtls_rsa_rsassa_pss_sign +extrn mbedtls_rsa_rsassa_pss_verify +extrn mbedtls_rsa_rsassa_pss_verify_ext +extrn mbedtls_rsa_self_test +extrn mbedtls_rsa_set_padding +extrn mbedtls_rsa_validate_crt +extrn mbedtls_rsa_validate_params +extrn mbedtls_sha1 +extrn mbedtls_sha1_clone +extrn mbedtls_sha1_finish +extrn mbedtls_sha1_finish_ret +extrn mbedtls_sha1_free +extrn mbedtls_sha1_init +extrn mbedtls_sha1_process +extrn mbedtls_sha1_ret +extrn mbedtls_sha1_self_test +extrn mbedtls_sha1_starts +extrn mbedtls_sha1_starts_ret +extrn mbedtls_sha1_update +extrn mbedtls_sha1_update_ret +extrn mbedtls_sha256 +extrn mbedtls_sha256_clone +extrn mbedtls_sha256_finish +extrn mbedtls_sha256_finish_ret +extrn mbedtls_sha256_free +extrn mbedtls_sha256_init +extrn mbedtls_sha256_process +extrn mbedtls_sha256_ret +extrn mbedtls_sha256_self_test +extrn mbedtls_sha256_starts +extrn mbedtls_sha256_starts_ret +extrn mbedtls_sha256_update +extrn mbedtls_sha256_update_ret +extrn mbedtls_sha512 +extrn mbedtls_sha512_clone +extrn mbedtls_sha512_finish +extrn mbedtls_sha512_finish_ret +extrn mbedtls_sha512_free +extrn mbedtls_sha512_init +extrn mbedtls_sha512_process +extrn mbedtls_sha512_ret +extrn mbedtls_sha512_self_test +extrn mbedtls_sha512_starts +extrn mbedtls_sha512_starts_ret +extrn mbedtls_sha512_update +extrn mbedtls_sha512_update_ret +extrn mbedtls_ssl_cache_free +extrn mbedtls_ssl_cache_get +extrn mbedtls_ssl_cache_init +extrn mbedtls_ssl_cache_set +extrn mbedtls_ssl_cache_set_max_entries +extrn mbedtls_ssl_cache_set_timeout +extrn mbedtls_ssl_check_cert_usage +extrn mbedtls_ssl_check_curve +extrn mbedtls_ssl_check_pending +extrn mbedtls_ssl_check_sig_hash +extrn mbedtls_ssl_ciphersuite_from_id +extrn mbedtls_ssl_ciphersuite_from_string +extrn mbedtls_ssl_ciphersuite_uses_ec +extrn mbedtls_ssl_ciphersuite_uses_psk +extrn mbedtls_ssl_close_notify +extrn mbedtls_ssl_conf_alpn_protocols +extrn mbedtls_ssl_conf_arc4_support +extrn mbedtls_ssl_conf_authmode +extrn mbedtls_ssl_conf_ca_chain +extrn mbedtls_ssl_conf_cbc_record_splitting +extrn mbedtls_ssl_conf_cert_profile +extrn mbedtls_ssl_conf_cert_req_ca_list +extrn mbedtls_ssl_conf_ciphersuites +extrn mbedtls_ssl_conf_ciphersuites_for_version +extrn mbedtls_ssl_conf_curves +extrn mbedtls_ssl_conf_dbg +extrn mbedtls_ssl_conf_dhm_min_bitlen +extrn mbedtls_ssl_conf_dh_param +extrn mbedtls_ssl_conf_dh_param_bin +extrn mbedtls_ssl_conf_dh_param_ctx +extrn mbedtls_ssl_conf_dtls_anti_replay +extrn mbedtls_ssl_conf_dtls_badmac_limit +extrn mbedtls_ssl_conf_dtls_cookies +extrn mbedtls_ssl_conf_encrypt_then_mac +extrn mbedtls_ssl_conf_endpoint +extrn mbedtls_ssl_conf_export_keys_cb +extrn mbedtls_ssl_conf_extended_master_secret +extrn mbedtls_ssl_conf_fallback +extrn mbedtls_ssl_conf_handshake_timeout +extrn mbedtls_ssl_config_defaults +extrn mbedtls_ssl_config_free +extrn mbedtls_ssl_config_init +extrn mbedtls_ssl_conf_legacy_renegotiation +extrn mbedtls_ssl_conf_max_frag_len +extrn mbedtls_ssl_conf_max_version +extrn mbedtls_ssl_conf_min_version +extrn mbedtls_ssl_conf_own_cert +extrn mbedtls_ssl_conf_psk +extrn mbedtls_ssl_conf_psk_cb +extrn mbedtls_ssl_conf_read_timeout +extrn mbedtls_ssl_conf_renegotiation +extrn mbedtls_ssl_conf_renegotiation_enforced +extrn mbedtls_ssl_conf_renegotiation_period +extrn mbedtls_ssl_conf_rng +extrn mbedtls_ssl_conf_session_cache +extrn mbedtls_ssl_conf_session_tickets +extrn mbedtls_ssl_conf_session_tickets_cb +extrn mbedtls_ssl_conf_sig_hashes +extrn mbedtls_ssl_conf_sni +extrn mbedtls_ssl_conf_transport +extrn mbedtls_ssl_conf_truncated_hmac +extrn mbedtls_ssl_conf_verify +extrn mbedtls_ssl_cookie_check +extrn mbedtls_ssl_cookie_free +extrn mbedtls_ssl_cookie_init +extrn mbedtls_ssl_cookie_set_timeout +extrn mbedtls_ssl_cookie_setup +extrn mbedtls_ssl_cookie_write +extrn mbedtls_ssl_derive_keys +extrn mbedtls_ssl_dtls_replay_check +extrn mbedtls_ssl_dtls_replay_update +extrn mbedtls_ssl_fetch_input +extrn mbedtls_ssl_flight_transmit +extrn mbedtls_ssl_flush_output +extrn mbedtls_ssl_free +extrn mbedtls_ssl_get_alpn_protocol +extrn mbedtls_ssl_get_bytes_avail +extrn mbedtls_ssl_get_ciphersuite +extrn mbedtls_ssl_get_ciphersuite_id +extrn mbedtls_ssl_get_ciphersuite_name +extrn mbedtls_ssl_get_ciphersuite_sig_alg +extrn mbedtls_ssl_get_ciphersuite_sig_pk_alg +extrn mbedtls_ssl_get_key_exchange_md_ssl_tls +extrn mbedtls_ssl_get_key_exchange_md_tls1_2 +extrn mbedtls_ssl_get_max_frag_len +extrn mbedtls_ssl_get_max_out_record_payload +extrn mbedtls_ssl_get_peer_cert +extrn mbedtls_ssl_get_record_expansion +extrn mbedtls_ssl_get_session +extrn mbedtls_ssl_get_verify_result +extrn mbedtls_ssl_get_version +extrn mbedtls_ssl_handle_message_type +extrn mbedtls_ssl_handshake +extrn mbedtls_ssl_handshake_client_step +extrn mbedtls_ssl_handshake_free +extrn mbedtls_ssl_handshake_server_step +extrn mbedtls_ssl_handshake_step +extrn mbedtls_ssl_handshake_wrapup +extrn mbedtls_ssl_hash_from_md_alg +extrn mbedtls_ssl_init +extrn mbedtls_ssl_list_ciphersuites +extrn mbedtls_ssl_md_alg_from_hash +extrn mbedtls_ssl_optimize_checksum +extrn mbedtls_ssl_parse_certificate +extrn mbedtls_ssl_parse_change_cipher_spec +extrn mbedtls_ssl_parse_finished +extrn mbedtls_ssl_pk_alg_from_sig +extrn mbedtls_ssl_prepare_handshake_record +extrn mbedtls_ssl_psk_derive_premaster +extrn mbedtls_ssl_read +extrn mbedtls_ssl_read_record +extrn mbedtls_ssl_read_version +extrn mbedtls_ssl_recv_flight_completed +extrn mbedtls_ssl_renegotiate +extrn mbedtls_ssl_resend +extrn mbedtls_ssl_reset_checksum +extrn mbedtls_ssl_send_alert_message +extrn mbedtls_ssl_send_fatal_handshake_failure +extrn mbedtls_ssl_send_flight_completed +extrn mbedtls_ssl_session_free +extrn mbedtls_ssl_session_init +extrn mbedtls_ssl_session_reset +extrn mbedtls_ssl_set_bio +extrn mbedtls_ssl_set_calc_verify_md +extrn mbedtls_ssl_set_client_transport_id +extrn mbedtls_ssl_set_datagram_packing +extrn mbedtls_ssl_set_hostname +extrn mbedtls_ssl_set_hs_authmode +extrn mbedtls_ssl_set_hs_ca_chain +extrn mbedtls_ssl_set_hs_own_cert +extrn mbedtls_ssl_set_hs_psk +extrn mbedtls_ssl_set_mtu +extrn mbedtls_ssl_set_session +extrn mbedtls_ssl_set_timer_cb +extrn mbedtls_ssl_setup +extrn mbedtls_ssl_sig_from_pk +extrn mbedtls_ssl_sig_from_pk_alg +extrn mbedtls_ssl_sig_hash_set_add +extrn mbedtls_ssl_sig_hash_set_const_hash +extrn mbedtls_ssl_sig_hash_set_find +extrn mbedtls_ssl_ticket_free +extrn mbedtls_ssl_ticket_init +extrn mbedtls_ssl_ticket_parse +extrn mbedtls_ssl_ticket_setup +extrn mbedtls_ssl_ticket_write +extrn mbedtls_ssl_transform_free +extrn mbedtls_ssl_update_handshake_status +extrn mbedtls_ssl_write +extrn mbedtls_ssl_write_certificate +extrn mbedtls_ssl_write_change_cipher_spec +extrn mbedtls_ssl_write_finished +extrn mbedtls_ssl_write_handshake_msg +extrn mbedtls_ssl_write_record +extrn mbedtls_ssl_write_version +extrn mbedtls_strerror +extrn mbedtls_sysfn_14_poll +extrn mbedtls_sysfn_18_4_poll +extrn mbedtls_sysfn_26_9_poll +extrn mbedtls_sysfn_37_0_poll +extrn mbedtls_sysfn_3_poll +extrn mbedtls_sysfn_66_3_poll +extrn mbedtls_sysfn_68_0_poll +extrn mbedtls_version_check_feature +extrn mbedtls_version_get_number +extrn mbedtls_version_get_string +extrn mbedtls_version_get_string_full +extrn mbedtls_x509_crl_free +extrn mbedtls_x509_crl_info +extrn mbedtls_x509_crl_init +extrn mbedtls_x509_crl_parse +extrn mbedtls_x509_crl_parse_der +extrn mbedtls_x509_crt_check_extended_key_usage +extrn mbedtls_x509_crt_check_key_usage +extrn mbedtls_x509_crt_free +extrn mbedtls_x509_crt_info +extrn mbedtls_x509_crt_init +extrn mbedtls_x509_crt_is_revoked +extrn mbedtls_x509_crt_parse +extrn mbedtls_x509_crt_parse_der +extrn mbedtls_x509_crt_verify +extrn mbedtls_x509_crt_verify_info +extrn mbedtls_x509_crt_verify_restartable +extrn mbedtls_x509_crt_verify_with_profile +extrn mbedtls_x509_csr_free +extrn mbedtls_x509_csr_info +extrn mbedtls_x509_csr_init +extrn mbedtls_x509_csr_parse +extrn mbedtls_x509_csr_parse_der +extrn mbedtls_x509_dn_gets +extrn mbedtls_x509_get_alg +extrn mbedtls_x509_get_alg_null +extrn mbedtls_x509_get_ext +extrn mbedtls_x509_get_name +extrn mbedtls_x509_get_rsassa_pss_params +extrn mbedtls_x509_get_serial +extrn mbedtls_x509_get_sig +extrn mbedtls_x509_get_sig_alg +extrn mbedtls_x509_get_time +extrn mbedtls_x509_key_size_helper +extrn mbedtls_x509_self_test +extrn mbedtls_x509_serial_gets +extrn mbedtls_x509_set_extension +extrn mbedtls_x509_sig_alg_gets +extrn mbedtls_x509_string_to_names +extrn mbedtls_x509_time_is_future +extrn mbedtls_x509_time_is_past +extrn mbedtls_x509write_crt_der +extrn mbedtls_x509write_crt_free +extrn mbedtls_x509write_crt_init +extrn mbedtls_x509write_crt_pem +extrn mbedtls_x509write_crt_set_authority_key_identifier +extrn mbedtls_x509write_crt_set_basic_constraints +extrn mbedtls_x509write_crt_set_extension +extrn mbedtls_x509write_crt_set_issuer_key +extrn mbedtls_x509write_crt_set_issuer_name +extrn mbedtls_x509write_crt_set_key_usage +extrn mbedtls_x509write_crt_set_md_alg +extrn mbedtls_x509write_crt_set_ns_cert_type +extrn mbedtls_x509write_crt_set_serial +extrn mbedtls_x509write_crt_set_subject_key +extrn mbedtls_x509write_crt_set_subject_key_identifier +extrn mbedtls_x509write_crt_set_subject_name +extrn mbedtls_x509write_crt_set_validity +extrn mbedtls_x509write_crt_set_version +extrn mbedtls_x509write_csr_der +extrn mbedtls_x509write_csr_free +extrn mbedtls_x509write_csr_init +extrn mbedtls_x509write_csr_pem +extrn mbedtls_x509write_csr_set_extension +extrn mbedtls_x509write_csr_set_key +extrn mbedtls_x509write_csr_set_key_usage +extrn mbedtls_x509write_csr_set_md_alg +extrn mbedtls_x509write_csr_set_ns_cert_type +extrn mbedtls_x509write_csr_set_subject_name +extrn mbedtls_x509_write_extensions +extrn mbedtls_x509_write_names +extrn mbedtls_x509_write_sig +extrn mbedtls_xtea_crypt_cbc +extrn mbedtls_xtea_crypt_ecb +extrn mbedtls_xtea_free +extrn mbedtls_xtea_init +extrn mbedtls_xtea_self_test +extrn mbedtls_xtea_setup +extrn mbedtls_test_cas_pem +extrn mbedtls_test_cas_pem_len + +section '.data' + +align 4 +@EXPORT: +export \ +mbedtls_aes_crypt_cbc ,'mbedtls_aes_crypt_cbc',\ +mbedtls_aes_crypt_cfb128,'mbedtls_aes_crypt_cfb128',\ +mbedtls_aes_crypt_cfb8,'mbedtls_aes_crypt_cfb8',\ +mbedtls_aes_crypt_ctr,'mbedtls_aes_crypt_ctr',\ +mbedtls_aes_crypt_ecb,'mbedtls_aes_crypt_ecb',\ +mbedtls_aes_crypt_ofb,'mbedtls_aes_crypt_ofb',\ +mbedtls_aes_crypt_xts,'mbedtls_aes_crypt_xts',\ +mbedtls_aes_decrypt,'mbedtls_aes_decrypt',\ +mbedtls_aes_encrypt,'mbedtls_aes_encrypt',\ +mbedtls_aes_free,'mbedtls_aes_free',\ +mbedtls_aes_init,'mbedtls_aes_init',\ +mbedtls_aes_self_test,'mbedtls_aes_self_test',\ +mbedtls_aes_setkey_dec,'mbedtls_aes_setkey_dec',\ +mbedtls_aes_setkey_enc,'mbedtls_aes_setkey_enc',\ +mbedtls_aes_xts_free,'mbedtls_aes_xts_free',\ +mbedtls_aes_xts_init,'mbedtls_aes_xts_init',\ +mbedtls_aes_xts_setkey_dec,'mbedtls_aes_xts_setkey_dec',\ +mbedtls_aes_xts_setkey_enc,'mbedtls_aes_xts_setkey_enc',\ +mbedtls_arc4_crypt,'mbedtls_arc4_crypt',\ +mbedtls_arc4_free,'mbedtls_arc4_free',\ +mbedtls_arc4_init,'mbedtls_arc4_init',\ +mbedtls_arc4_self_test,'mbedtls_arc4_self_test',\ +mbedtls_arc4_setup,'mbedtls_arc4_setup',\ +mbedtls_asn1_find_named_data,'mbedtls_asn1_find_named_data',\ +mbedtls_asn1_free_named_data,'mbedtls_asn1_free_named_data',\ +mbedtls_asn1_free_named_data_list,'mbedtls_asn1_free_named_data_list',\ +mbedtls_asn1_get_alg,'mbedtls_asn1_get_alg',\ +mbedtls_asn1_get_alg_null,'mbedtls_asn1_get_alg_null',\ +mbedtls_asn1_get_bitstring,'mbedtls_asn1_get_bitstring',\ +mbedtls_asn1_get_bitstring_null,'mbedtls_asn1_get_bitstring_null',\ +mbedtls_asn1_get_bool,'mbedtls_asn1_get_bool',\ +mbedtls_asn1_get_int,'mbedtls_asn1_get_int',\ +mbedtls_asn1_get_len,'mbedtls_asn1_get_len',\ +mbedtls_asn1_get_mpi,'mbedtls_asn1_get_mpi',\ +mbedtls_asn1_get_sequence_of,'mbedtls_asn1_get_sequence_of',\ +mbedtls_asn1_get_tag,'mbedtls_asn1_get_tag',\ +mbedtls_asn1_store_named_data,'mbedtls_asn1_store_named_data',\ +mbedtls_asn1_write_algorithm_identifier,'mbedtls_asn1_write_algorithm_identifier',\ +mbedtls_asn1_write_bitstring,'mbedtls_asn1_write_bitstring',\ +mbedtls_asn1_write_bool,'mbedtls_asn1_write_bool',\ +mbedtls_asn1_write_ia5_string,'mbedtls_asn1_write_ia5_string',\ +mbedtls_asn1_write_int,'mbedtls_asn1_write_int',\ +mbedtls_asn1_write_len,'mbedtls_asn1_write_len',\ +mbedtls_asn1_write_mpi,'mbedtls_asn1_write_mpi',\ +mbedtls_asn1_write_null,'mbedtls_asn1_write_null',\ +mbedtls_asn1_write_octet_string,'mbedtls_asn1_write_octet_string',\ +mbedtls_asn1_write_oid,'mbedtls_asn1_write_oid',\ +mbedtls_asn1_write_printable_string,'mbedtls_asn1_write_printable_string',\ +mbedtls_asn1_write_raw_buffer,'mbedtls_asn1_write_raw_buffer',\ +mbedtls_asn1_write_tag,'mbedtls_asn1_write_tag',\ +mbedtls_asn1_write_tagged_string,'mbedtls_asn1_write_tagged_string',\ +mbedtls_asn1_write_utf8_string,'mbedtls_asn1_write_utf8_string',\ +mbedtls_base64_decode,'mbedtls_base64_decode',\ +mbedtls_base64_encode,'mbedtls_base64_encode',\ +mbedtls_base64_self_test,'mbedtls_base64_self_test',\ +mbedtls_blowfish_crypt_cbc,'mbedtls_blowfish_crypt_cbc',\ +mbedtls_blowfish_crypt_cfb64,'mbedtls_blowfish_crypt_cfb64',\ +mbedtls_blowfish_crypt_ctr,'mbedtls_blowfish_crypt_ctr',\ +mbedtls_blowfish_crypt_ecb,'mbedtls_blowfish_crypt_ecb',\ +mbedtls_blowfish_free,'mbedtls_blowfish_free',\ +mbedtls_blowfish_init,'mbedtls_blowfish_init',\ +mbedtls_blowfish_setkey,'mbedtls_blowfish_setkey',\ +mbedtls_camellia_crypt_cbc,'mbedtls_camellia_crypt_cbc',\ +mbedtls_camellia_crypt_cfb128,'mbedtls_camellia_crypt_cfb128',\ +mbedtls_camellia_crypt_ctr,'mbedtls_camellia_crypt_ctr',\ +mbedtls_camellia_crypt_ecb,'mbedtls_camellia_crypt_ecb',\ +mbedtls_camellia_free,'mbedtls_camellia_free',\ +mbedtls_camellia_init,'mbedtls_camellia_init',\ +mbedtls_camellia_self_test,'mbedtls_camellia_self_test',\ +mbedtls_camellia_setkey_dec,'mbedtls_camellia_setkey_dec',\ +mbedtls_camellia_setkey_enc,'mbedtls_camellia_setkey_enc',\ +mbedtls_ccm_auth_decrypt,'mbedtls_ccm_auth_decrypt',\ +mbedtls_ccm_encrypt_and_tag,'mbedtls_ccm_encrypt_and_tag',\ +mbedtls_ccm_free,'mbedtls_ccm_free',\ +mbedtls_ccm_init,'mbedtls_ccm_init',\ +mbedtls_ccm_self_test,'mbedtls_ccm_self_test',\ +mbedtls_ccm_setkey,'mbedtls_ccm_setkey',\ +mbedtls_ccm_star_auth_decrypt,'mbedtls_ccm_star_auth_decrypt',\ +mbedtls_ccm_star_encrypt_and_tag,'mbedtls_ccm_star_encrypt_and_tag',\ +mbedtls_chacha20_crypt,'mbedtls_chacha20_crypt',\ +mbedtls_chacha20_free,'mbedtls_chacha20_free',\ +mbedtls_chacha20_init,'mbedtls_chacha20_init',\ +mbedtls_chacha20_self_test,'mbedtls_chacha20_self_test',\ +mbedtls_chacha20_setkey,'mbedtls_chacha20_setkey',\ +mbedtls_chacha20_starts,'mbedtls_chacha20_starts',\ +mbedtls_chacha20_update,'mbedtls_chacha20_update',\ +mbedtls_chachapoly_auth_decrypt,'mbedtls_chachapoly_auth_decrypt',\ +mbedtls_chachapoly_encrypt_and_tag,'mbedtls_chachapoly_encrypt_and_tag',\ +mbedtls_chachapoly_finish,'mbedtls_chachapoly_finish',\ +mbedtls_chachapoly_free,'mbedtls_chachapoly_free',\ +mbedtls_chachapoly_init,'mbedtls_chachapoly_init',\ +mbedtls_chachapoly_self_test,'mbedtls_chachapoly_self_test',\ +mbedtls_chachapoly_setkey,'mbedtls_chachapoly_setkey',\ +mbedtls_chachapoly_starts,'mbedtls_chachapoly_starts',\ +mbedtls_chachapoly_update,'mbedtls_chachapoly_update',\ +mbedtls_chachapoly_update_aad,'mbedtls_chachapoly_update_aad',\ +mbedtls_cipher_auth_decrypt,'mbedtls_cipher_auth_decrypt',\ +mbedtls_cipher_auth_encrypt,'mbedtls_cipher_auth_encrypt',\ +mbedtls_cipher_check_tag,'mbedtls_cipher_check_tag',\ +mbedtls_cipher_crypt,'mbedtls_cipher_crypt',\ +mbedtls_cipher_finish,'mbedtls_cipher_finish',\ +mbedtls_cipher_free,'mbedtls_cipher_free',\ +mbedtls_cipher_info_from_string,'mbedtls_cipher_info_from_string',\ +mbedtls_cipher_info_from_type,'mbedtls_cipher_info_from_type',\ +mbedtls_cipher_info_from_values,'mbedtls_cipher_info_from_values',\ +mbedtls_cipher_init,'mbedtls_cipher_init',\ +mbedtls_cipher_list,'mbedtls_cipher_list',\ +mbedtls_cipher_reset,'mbedtls_cipher_reset',\ +mbedtls_cipher_set_iv,'mbedtls_cipher_set_iv',\ +mbedtls_cipher_setkey,'mbedtls_cipher_setkey',\ +mbedtls_cipher_set_padding_mode,'mbedtls_cipher_set_padding_mode',\ +mbedtls_cipher_setup,'mbedtls_cipher_setup',\ +mbedtls_cipher_update,'mbedtls_cipher_update',\ +mbedtls_cipher_update_ad,'mbedtls_cipher_update_ad',\ +mbedtls_cipher_write_tag,'mbedtls_cipher_write_tag',\ +mbedtls_ctr_drbg_free,'mbedtls_ctr_drbg_free',\ +mbedtls_ctr_drbg_init,'mbedtls_ctr_drbg_init',\ +mbedtls_ctr_drbg_random,'mbedtls_ctr_drbg_random',\ +mbedtls_ctr_drbg_random_with_add,'mbedtls_ctr_drbg_random_with_add',\ +mbedtls_ctr_drbg_reseed,'mbedtls_ctr_drbg_reseed',\ +mbedtls_ctr_drbg_seed,'mbedtls_ctr_drbg_seed',\ +mbedtls_ctr_drbg_seed_entropy_len,'mbedtls_ctr_drbg_seed_entropy_len',\ +mbedtls_ctr_drbg_self_test,'mbedtls_ctr_drbg_self_test',\ +mbedtls_ctr_drbg_set_entropy_len,'mbedtls_ctr_drbg_set_entropy_len',\ +mbedtls_ctr_drbg_set_prediction_resistance,'mbedtls_ctr_drbg_set_prediction_resistance',\ +mbedtls_ctr_drbg_set_reseed_interval,'mbedtls_ctr_drbg_set_reseed_interval',\ +mbedtls_ctr_drbg_update,'mbedtls_ctr_drbg_update',\ +mbedtls_ctr_drbg_update_ret,'mbedtls_ctr_drbg_update_ret',\ +mbedtls_debug_print_buf,'mbedtls_debug_print_buf',\ +mbedtls_debug_print_crt,'mbedtls_debug_print_crt',\ +mbedtls_debug_print_ecp,'mbedtls_debug_print_ecp',\ +mbedtls_debug_printf_ecdh,'mbedtls_debug_printf_ecdh',\ +mbedtls_debug_print_mpi,'mbedtls_debug_print_mpi',\ +mbedtls_debug_print_msg,'mbedtls_debug_print_msg',\ +mbedtls_debug_print_ret,'mbedtls_debug_print_ret',\ +mbedtls_debug_set_threshold,'mbedtls_debug_set_threshold',\ +mbedtls_des3_crypt_cbc,'mbedtls_des3_crypt_cbc',\ +mbedtls_des3_crypt_ecb,'mbedtls_des3_crypt_ecb',\ +mbedtls_des3_free,'mbedtls_des3_free',\ +mbedtls_des3_init,'mbedtls_des3_init',\ +mbedtls_des3_set2key_dec,'mbedtls_des3_set2key_dec',\ +mbedtls_des3_set2key_enc,'mbedtls_des3_set2key_enc',\ +mbedtls_des3_set3key_dec,'mbedtls_des3_set3key_dec',\ +mbedtls_des3_set3key_enc,'mbedtls_des3_set3key_enc',\ +mbedtls_des_crypt_cbc,'mbedtls_des_crypt_cbc',\ +mbedtls_des_crypt_ecb,'mbedtls_des_crypt_ecb',\ +mbedtls_des_free,'mbedtls_des_free',\ +mbedtls_des_init,'mbedtls_des_init',\ +mbedtls_des_key_check_key_parity,'mbedtls_des_key_check_key_parity',\ +mbedtls_des_key_check_weak,'mbedtls_des_key_check_weak',\ +mbedtls_des_key_set_parity,'mbedtls_des_key_set_parity',\ +mbedtls_des_self_test,'mbedtls_des_self_test',\ +mbedtls_des_setkey,'mbedtls_des_setkey',\ +mbedtls_des_setkey_dec,'mbedtls_des_setkey_dec',\ +mbedtls_des_setkey_enc,'mbedtls_des_setkey_enc',\ +mbedtls_dhm_calc_secret,'mbedtls_dhm_calc_secret',\ +mbedtls_dhm_free,'mbedtls_dhm_free',\ +mbedtls_dhm_init,'mbedtls_dhm_init',\ +mbedtls_dhm_make_params,'mbedtls_dhm_make_params',\ +mbedtls_dhm_make_public,'mbedtls_dhm_make_public',\ +mbedtls_dhm_parse_dhm,'mbedtls_dhm_parse_dhm',\ +mbedtls_dhm_read_params,'mbedtls_dhm_read_params',\ +mbedtls_dhm_read_public,'mbedtls_dhm_read_public',\ +mbedtls_dhm_self_test,'mbedtls_dhm_self_test',\ +mbedtls_dhm_set_group,'mbedtls_dhm_set_group',\ +mbedtls_ecdh_calc_secret,'mbedtls_ecdh_calc_secret',\ +mbedtls_ecdh_compute_shared,'mbedtls_ecdh_compute_shared',\ +mbedtls_ecdh_free,'mbedtls_ecdh_free',\ +mbedtls_ecdh_gen_public,'mbedtls_ecdh_gen_public',\ +mbedtls_ecdh_get_params,'mbedtls_ecdh_get_params',\ +mbedtls_ecdh_init,'mbedtls_ecdh_init',\ +mbedtls_ecdh_make_params,'mbedtls_ecdh_make_params',\ +mbedtls_ecdh_make_public,'mbedtls_ecdh_make_public',\ +mbedtls_ecdh_read_params,'mbedtls_ecdh_read_params',\ +mbedtls_ecdh_read_public,'mbedtls_ecdh_read_public',\ +mbedtls_ecdh_setup,'mbedtls_ecdh_setup',\ +mbedtls_ecdsa_free,'mbedtls_ecdsa_free',\ +mbedtls_ecdsa_from_keypair,'mbedtls_ecdsa_from_keypair',\ +mbedtls_ecdsa_genkey,'mbedtls_ecdsa_genkey',\ +mbedtls_ecdsa_init,'mbedtls_ecdsa_init',\ +mbedtls_ecdsa_read_signature,'mbedtls_ecdsa_read_signature',\ +mbedtls_ecdsa_read_signature_restartable,'mbedtls_ecdsa_read_signature_restartable',\ +mbedtls_ecdsa_sign,'mbedtls_ecdsa_sign',\ +mbedtls_ecdsa_sign_det,'mbedtls_ecdsa_sign_det',\ +mbedtls_ecdsa_sign_det_ext,'mbedtls_ecdsa_sign_det_ext',\ +mbedtls_ecdsa_verify,'mbedtls_ecdsa_verify',\ +mbedtls_ecdsa_write_signature,'mbedtls_ecdsa_write_signature',\ +mbedtls_ecdsa_write_signature_det,'mbedtls_ecdsa_write_signature_det',\ +mbedtls_ecdsa_write_signature_restartable,'mbedtls_ecdsa_write_signature_restartable',\ +mbedtls_ecp_check_privkey,'mbedtls_ecp_check_privkey',\ +mbedtls_ecp_check_pubkey,'mbedtls_ecp_check_pubkey',\ +mbedtls_ecp_check_pub_priv,'mbedtls_ecp_check_pub_priv',\ +mbedtls_ecp_copy,'mbedtls_ecp_copy',\ +mbedtls_ecp_curve_info_from_grp_id,'mbedtls_ecp_curve_info_from_grp_id',\ +mbedtls_ecp_curve_info_from_name,'mbedtls_ecp_curve_info_from_name',\ +mbedtls_ecp_curve_info_from_tls_id,'mbedtls_ecp_curve_info_from_tls_id',\ +mbedtls_ecp_curve_list,'mbedtls_ecp_curve_list',\ +mbedtls_ecp_gen_key,'mbedtls_ecp_gen_key',\ +mbedtls_ecp_gen_keypair,'mbedtls_ecp_gen_keypair',\ +mbedtls_ecp_gen_keypair_base,'mbedtls_ecp_gen_keypair_base',\ +mbedtls_ecp_gen_privkey,'mbedtls_ecp_gen_privkey',\ +mbedtls_ecp_group_copy,'mbedtls_ecp_group_copy',\ +mbedtls_ecp_group_free,'mbedtls_ecp_group_free',\ +mbedtls_ecp_group_init,'mbedtls_ecp_group_init',\ +mbedtls_ecp_group_load,'mbedtls_ecp_group_load',\ +mbedtls_ecp_grp_id_list,'mbedtls_ecp_grp_id_list',\ +mbedtls_ecp_is_zero,'mbedtls_ecp_is_zero',\ +mbedtls_ecp_keypair_free,'mbedtls_ecp_keypair_free',\ +mbedtls_ecp_keypair_init,'mbedtls_ecp_keypair_init',\ +mbedtls_ecp_mul,'mbedtls_ecp_mul',\ +mbedtls_ecp_muladd,'mbedtls_ecp_muladd',\ +mbedtls_ecp_muladd_restartable,'mbedtls_ecp_muladd_restartable',\ +mbedtls_ecp_mul_restartable,'mbedtls_ecp_mul_restartable',\ +mbedtls_ecp_point_cmp,'mbedtls_ecp_point_cmp',\ +mbedtls_ecp_point_free,'mbedtls_ecp_point_free',\ +mbedtls_ecp_point_init,'mbedtls_ecp_point_init',\ +mbedtls_ecp_point_read_binary,'mbedtls_ecp_point_read_binary',\ +mbedtls_ecp_point_read_string,'mbedtls_ecp_point_read_string',\ +mbedtls_ecp_point_write_binary,'mbedtls_ecp_point_write_binary',\ +mbedtls_ecp_self_test,'mbedtls_ecp_self_test',\ +mbedtls_ecp_set_zero,'mbedtls_ecp_set_zero',\ +mbedtls_ecp_tls_read_group,'mbedtls_ecp_tls_read_group',\ +mbedtls_ecp_tls_read_group_id,'mbedtls_ecp_tls_read_group_id',\ +mbedtls_ecp_tls_read_point,'mbedtls_ecp_tls_read_point',\ +mbedtls_ecp_tls_write_group,'mbedtls_ecp_tls_write_group',\ +mbedtls_ecp_tls_write_point,'mbedtls_ecp_tls_write_point',\ +mbedtls_entropy_add_source,'mbedtls_entropy_add_source',\ +mbedtls_entropy_free,'mbedtls_entropy_free',\ +mbedtls_entropy_func,'mbedtls_entropy_func',\ +mbedtls_entropy_gather,'mbedtls_entropy_gather',\ +mbedtls_entropy_init,'mbedtls_entropy_init',\ +mbedtls_entropy_self_test,'mbedtls_entropy_self_test',\ +mbedtls_entropy_update_manual,'mbedtls_entropy_update_manual',\ +mbedtls_gcm_auth_decrypt,'mbedtls_gcm_auth_decrypt',\ +mbedtls_gcm_crypt_and_tag,'mbedtls_gcm_crypt_and_tag',\ +mbedtls_gcm_finish,'mbedtls_gcm_finish',\ +mbedtls_gcm_free,'mbedtls_gcm_free',\ +mbedtls_gcm_init,'mbedtls_gcm_init',\ +mbedtls_gcm_self_test,'mbedtls_gcm_self_test',\ +mbedtls_gcm_setkey,'mbedtls_gcm_setkey',\ +mbedtls_gcm_starts,'mbedtls_gcm_starts',\ +mbedtls_gcm_update,'mbedtls_gcm_update',\ +mbedtls_hkdf,'mbedtls_hkdf',\ +mbedtls_hkdf_expand,'mbedtls_hkdf_expand',\ +mbedtls_hkdf_extract,'mbedtls_hkdf_extract',\ +mbedtls_hmac_drbg_free,'mbedtls_hmac_drbg_free',\ +mbedtls_hmac_drbg_init,'mbedtls_hmac_drbg_init',\ +mbedtls_hmac_drbg_random,'mbedtls_hmac_drbg_random',\ +mbedtls_hmac_drbg_random_with_add,'mbedtls_hmac_drbg_random_with_add',\ +mbedtls_hmac_drbg_reseed,'mbedtls_hmac_drbg_reseed',\ +mbedtls_hmac_drbg_seed,'mbedtls_hmac_drbg_seed',\ +mbedtls_hmac_drbg_seed_buf,'mbedtls_hmac_drbg_seed_buf',\ +mbedtls_hmac_drbg_self_test,'mbedtls_hmac_drbg_self_test',\ +mbedtls_hmac_drbg_set_entropy_len,'mbedtls_hmac_drbg_set_entropy_len',\ +mbedtls_hmac_drbg_set_prediction_resistance,'mbedtls_hmac_drbg_set_prediction_resistance',\ +mbedtls_hmac_drbg_set_reseed_interval,'mbedtls_hmac_drbg_set_reseed_interval',\ +mbedtls_hmac_drbg_update,'mbedtls_hmac_drbg_update',\ +mbedtls_hmac_drbg_update_ret,'mbedtls_hmac_drbg_update_ret',\ +mbedtls_init,'mbedtls_init',\ +mbedtls_internal_aes_decrypt,'mbedtls_internal_aes_decrypt',\ +mbedtls_internal_aes_encrypt,'mbedtls_internal_aes_encrypt',\ +mbedtls_internal_md5_process,'mbedtls_internal_md5_process',\ +mbedtls_internal_ripemd160_process,'mbedtls_internal_ripemd160_process',\ +mbedtls_internal_sha1_process,'mbedtls_internal_sha1_process',\ +mbedtls_internal_sha256_process,'mbedtls_internal_sha256_process',\ +mbedtls_internal_sha512_process,'mbedtls_internal_sha512_process',\ +mbedtls_md,'mbedtls_md',\ +mbedtls_md5,'mbedtls_md5',\ +mbedtls_md5_clone,'mbedtls_md5_clone',\ +mbedtls_md5_finish,'mbedtls_md5_finish',\ +mbedtls_md5_finish_ret,'mbedtls_md5_finish_ret',\ +mbedtls_md5_free,'mbedtls_md5_free',\ +mbedtls_md5_init,'mbedtls_md5_init',\ +mbedtls_md5_process,'mbedtls_md5_process',\ +mbedtls_md5_ret,'mbedtls_md5_ret',\ +mbedtls_md5_self_test,'mbedtls_md5_self_test',\ +mbedtls_md5_starts,'mbedtls_md5_starts',\ +mbedtls_md5_starts_ret,'mbedtls_md5_starts_ret',\ +mbedtls_md5_update,'mbedtls_md5_update',\ +mbedtls_md5_update_ret,'mbedtls_md5_update_ret',\ +mbedtls_md_clone,'mbedtls_md_clone',\ +mbedtls_md_finish,'mbedtls_md_finish',\ +mbedtls_md_free,'mbedtls_md_free',\ +mbedtls_md_get_name,'mbedtls_md_get_name',\ +mbedtls_md_get_size,'mbedtls_md_get_size',\ +mbedtls_md_get_type,'mbedtls_md_get_type',\ +mbedtls_md_hmac,'mbedtls_md_hmac',\ +mbedtls_md_hmac_finish,'mbedtls_md_hmac_finish',\ +mbedtls_md_hmac_reset,'mbedtls_md_hmac_reset',\ +mbedtls_md_hmac_starts,'mbedtls_md_hmac_starts',\ +mbedtls_md_hmac_update,'mbedtls_md_hmac_update',\ +mbedtls_md_info_from_string,'mbedtls_md_info_from_string',\ +mbedtls_md_info_from_type,'mbedtls_md_info_from_type',\ +mbedtls_md_init,'mbedtls_md_init',\ +mbedtls_md_init_ctx,'mbedtls_md_init_ctx',\ +mbedtls_md_list,'mbedtls_md_list',\ +mbedtls_md_process,'mbedtls_md_process',\ +mbedtls_md_setup,'mbedtls_md_setup',\ +mbedtls_md_starts,'mbedtls_md_starts',\ +mbedtls_md_update,'mbedtls_md_update',\ +mbedtls_mpi_add_abs,'mbedtls_mpi_add_abs',\ +mbedtls_mpi_add_int,'mbedtls_mpi_add_int',\ +mbedtls_mpi_add_mpi,'mbedtls_mpi_add_mpi',\ +mbedtls_mpi_bitlen,'mbedtls_mpi_bitlen',\ +mbedtls_mpi_cmp_abs,'mbedtls_mpi_cmp_abs',\ +mbedtls_mpi_cmp_int,'mbedtls_mpi_cmp_int',\ +mbedtls_mpi_cmp_mpi,'mbedtls_mpi_cmp_mpi',\ +mbedtls_mpi_copy,'mbedtls_mpi_copy',\ +mbedtls_mpi_div_int,'mbedtls_mpi_div_int',\ +mbedtls_mpi_div_mpi,'mbedtls_mpi_div_mpi',\ +mbedtls_mpi_exp_mod,'mbedtls_mpi_exp_mod',\ +mbedtls_mpi_fill_random,'mbedtls_mpi_fill_random',\ +mbedtls_mpi_free,'mbedtls_mpi_free',\ +mbedtls_mpi_gcd,'mbedtls_mpi_gcd',\ +mbedtls_mpi_gen_prime,'mbedtls_mpi_gen_prime',\ +mbedtls_mpi_get_bit,'mbedtls_mpi_get_bit',\ +mbedtls_mpi_grow,'mbedtls_mpi_grow',\ +mbedtls_mpi_init,'mbedtls_mpi_init',\ +mbedtls_mpi_inv_mod,'mbedtls_mpi_inv_mod',\ +mbedtls_mpi_is_prime,'mbedtls_mpi_is_prime',\ +mbedtls_mpi_is_prime_ext,'mbedtls_mpi_is_prime_ext',\ +mbedtls_mpi_lsb,'mbedtls_mpi_lsb',\ +mbedtls_mpi_lset,'mbedtls_mpi_lset',\ +mbedtls_mpi_lt_mpi_ct,'mbedtls_mpi_lt_mpi_ct',\ +mbedtls_mpi_mod_int,'mbedtls_mpi_mod_int',\ +mbedtls_mpi_mod_mpi,'mbedtls_mpi_mod_mpi',\ +mbedtls_mpi_mul_int,'mbedtls_mpi_mul_int',\ +mbedtls_mpi_mul_mpi,'mbedtls_mpi_mul_mpi',\ +mbedtls_mpi_read_binary,'mbedtls_mpi_read_binary',\ +mbedtls_mpi_read_string,'mbedtls_mpi_read_string',\ +mbedtls_mpi_safe_cond_assign,'mbedtls_mpi_safe_cond_assign',\ +mbedtls_mpi_safe_cond_swap,'mbedtls_mpi_safe_cond_swap',\ +mbedtls_mpi_self_test,'mbedtls_mpi_self_test',\ +mbedtls_mpi_set_bit,'mbedtls_mpi_set_bit',\ +mbedtls_mpi_shift_l,'mbedtls_mpi_shift_l',\ +mbedtls_mpi_shift_r,'mbedtls_mpi_shift_r',\ +mbedtls_mpi_shrink,'mbedtls_mpi_shrink',\ +mbedtls_mpi_size,'mbedtls_mpi_size',\ +mbedtls_mpi_sub_abs,'mbedtls_mpi_sub_abs',\ +mbedtls_mpi_sub_int,'mbedtls_mpi_sub_int',\ +mbedtls_mpi_sub_mpi,'mbedtls_mpi_sub_mpi',\ +mbedtls_mpi_swap,'mbedtls_mpi_swap',\ +mbedtls_mpi_write_binary,'mbedtls_mpi_write_binary',\ +mbedtls_mpi_write_string,'mbedtls_mpi_write_string',\ +mbedtls_net_connect,'mbedtls_net_connect',\ +mbedtls_net_free,'mbedtls_net_free',\ +mbedtls_net_init,'mbedtls_net_init',\ +mbedtls_net_recv,'mbedtls_net_recv',\ +mbedtls_net_send,'mbedtls_net_send',\ +mbedtls_oid_get_attr_short_name,'mbedtls_oid_get_attr_short_name',\ +mbedtls_oid_get_cipher_alg,'mbedtls_oid_get_cipher_alg',\ +mbedtls_oid_get_ec_grp,'mbedtls_oid_get_ec_grp',\ +mbedtls_oid_get_extended_key_usage,'mbedtls_oid_get_extended_key_usage',\ +mbedtls_oid_get_md_alg,'mbedtls_oid_get_md_alg',\ +mbedtls_oid_get_md_hmac,'mbedtls_oid_get_md_hmac',\ +mbedtls_oid_get_numeric_string,'mbedtls_oid_get_numeric_string',\ +mbedtls_oid_get_oid_by_ec_grp,'mbedtls_oid_get_oid_by_ec_grp',\ +mbedtls_oid_get_oid_by_md,'mbedtls_oid_get_oid_by_md',\ +mbedtls_oid_get_oid_by_pk_alg,'mbedtls_oid_get_oid_by_pk_alg',\ +mbedtls_oid_get_oid_by_sig_alg,'mbedtls_oid_get_oid_by_sig_alg',\ +mbedtls_oid_get_pk_alg,'mbedtls_oid_get_pk_alg',\ +mbedtls_oid_get_pkcs12_pbe_alg,'mbedtls_oid_get_pkcs12_pbe_alg',\ +mbedtls_oid_get_sig_alg,'mbedtls_oid_get_sig_alg',\ +mbedtls_oid_get_sig_alg_desc,'mbedtls_oid_get_sig_alg_desc',\ +mbedtls_oid_get_x509_ext_type,'mbedtls_oid_get_x509_ext_type',\ +mbedtls_padlock_has_support,'mbedtls_padlock_has_support',\ +mbedtls_padlock_xcryptcbc,'mbedtls_padlock_xcryptcbc',\ +mbedtls_padlock_xcryptecb,'mbedtls_padlock_xcryptecb',\ +mbedtls_pem_free,'mbedtls_pem_free',\ +mbedtls_pem_init,'mbedtls_pem_init',\ +mbedtls_pem_read_buffer,'mbedtls_pem_read_buffer',\ +mbedtls_pem_write_buffer,'mbedtls_pem_write_buffer',\ +mbedtls_pk_can_do,'mbedtls_pk_can_do',\ +mbedtls_pk_check_pair,'mbedtls_pk_check_pair',\ +mbedtls_pkcs12_derivation,'mbedtls_pkcs12_derivation',\ +mbedtls_pkcs12_pbe,'mbedtls_pkcs12_pbe',\ +mbedtls_pkcs12_pbe_sha1_rc4_128,'mbedtls_pkcs12_pbe_sha1_rc4_128',\ +mbedtls_pkcs5_pbes2,'mbedtls_pkcs5_pbes2',\ +mbedtls_pkcs5_pbkdf2_hmac,'mbedtls_pkcs5_pbkdf2_hmac',\ +mbedtls_pkcs5_self_test,'mbedtls_pkcs5_self_test',\ +mbedtls_pk_debug,'mbedtls_pk_debug',\ +mbedtls_pk_decrypt,'mbedtls_pk_decrypt',\ +mbedtls_pk_encrypt,'mbedtls_pk_encrypt',\ +mbedtls_pk_free,'mbedtls_pk_free',\ +mbedtls_pk_get_bitlen,'mbedtls_pk_get_bitlen',\ +mbedtls_pk_get_name,'mbedtls_pk_get_name',\ +mbedtls_pk_get_type,'mbedtls_pk_get_type',\ +mbedtls_pk_info_from_type,'mbedtls_pk_info_from_type',\ +mbedtls_pk_init,'mbedtls_pk_init',\ +mbedtls_pk_parse_key,'mbedtls_pk_parse_key',\ +mbedtls_pk_parse_public_key,'mbedtls_pk_parse_public_key',\ +mbedtls_pk_parse_subpubkey,'mbedtls_pk_parse_subpubkey',\ +mbedtls_pk_setup,'mbedtls_pk_setup',\ +mbedtls_pk_setup_rsa_alt,'mbedtls_pk_setup_rsa_alt',\ +mbedtls_pk_sign,'mbedtls_pk_sign',\ +mbedtls_pk_sign_restartable,'mbedtls_pk_sign_restartable',\ +mbedtls_pk_verify,'mbedtls_pk_verify',\ +mbedtls_pk_verify_ext,'mbedtls_pk_verify_ext',\ +mbedtls_pk_verify_restartable,'mbedtls_pk_verify_restartable',\ +mbedtls_pk_write_key_der,'mbedtls_pk_write_key_der',\ +mbedtls_pk_write_key_pem,'mbedtls_pk_write_key_pem',\ +mbedtls_pk_write_pubkey,'mbedtls_pk_write_pubkey',\ +mbedtls_pk_write_pubkey_der,'mbedtls_pk_write_pubkey_der',\ +mbedtls_pk_write_pubkey_pem,'mbedtls_pk_write_pubkey_pem',\ +mbedtls_platform_gmtime_r,'mbedtls_platform_gmtime_r',\ +mbedtls_platform_setup,'mbedtls_platform_setup',\ +mbedtls_platform_teardown,'mbedtls_platform_teardown',\ +mbedtls_platform_zeroize,'mbedtls_platform_zeroize',\ +mbedtls_poly1305_finish,'mbedtls_poly1305_finish',\ +mbedtls_poly1305_free,'mbedtls_poly1305_free',\ +mbedtls_poly1305_init,'mbedtls_poly1305_init',\ +mbedtls_poly1305_mac,'mbedtls_poly1305_mac',\ +mbedtls_poly1305_self_test,'mbedtls_poly1305_self_test',\ +mbedtls_poly1305_starts,'mbedtls_poly1305_starts',\ +mbedtls_poly1305_update,'mbedtls_poly1305_update',\ +mbedtls_ripemd160,'mbedtls_ripemd160',\ +mbedtls_ripemd160_clone,'mbedtls_ripemd160_clone',\ +mbedtls_ripemd160_finish,'mbedtls_ripemd160_finish',\ +mbedtls_ripemd160_finish_ret,'mbedtls_ripemd160_finish_ret',\ +mbedtls_ripemd160_free,'mbedtls_ripemd160_free',\ +mbedtls_ripemd160_init,'mbedtls_ripemd160_init',\ +mbedtls_ripemd160_process,'mbedtls_ripemd160_process',\ +mbedtls_ripemd160_ret,'mbedtls_ripemd160_ret',\ +mbedtls_ripemd160_self_test,'mbedtls_ripemd160_self_test',\ +mbedtls_ripemd160_starts,'mbedtls_ripemd160_starts',\ +mbedtls_ripemd160_starts_ret,'mbedtls_ripemd160_starts_ret',\ +mbedtls_ripemd160_update,'mbedtls_ripemd160_update',\ +mbedtls_ripemd160_update_ret,'mbedtls_ripemd160_update_ret',\ +mbedtls_rsa_check_privkey,'mbedtls_rsa_check_privkey',\ +mbedtls_rsa_check_pubkey,'mbedtls_rsa_check_pubkey',\ +mbedtls_rsa_check_pub_priv,'mbedtls_rsa_check_pub_priv',\ +mbedtls_rsa_complete,'mbedtls_rsa_complete',\ +mbedtls_rsa_copy,'mbedtls_rsa_copy',\ +mbedtls_rsa_deduce_crt,'mbedtls_rsa_deduce_crt',\ +mbedtls_rsa_deduce_primes,'mbedtls_rsa_deduce_primes',\ +mbedtls_rsa_deduce_private_exponent,'mbedtls_rsa_deduce_private_exponent',\ +mbedtls_rsa_export,'mbedtls_rsa_export',\ +mbedtls_rsa_export_crt,'mbedtls_rsa_export_crt',\ +mbedtls_rsa_export_raw,'mbedtls_rsa_export_raw',\ +mbedtls_rsa_free,'mbedtls_rsa_free',\ +mbedtls_rsa_gen_key,'mbedtls_rsa_gen_key',\ +mbedtls_rsa_get_len,'mbedtls_rsa_get_len',\ +mbedtls_rsa_import,'mbedtls_rsa_import',\ +mbedtls_rsa_import_raw,'mbedtls_rsa_import_raw',\ +mbedtls_rsa_init,'mbedtls_rsa_init',\ +mbedtls_rsa_pkcs1_decrypt,'mbedtls_rsa_pkcs1_decrypt',\ +mbedtls_rsa_pkcs1_encrypt,'mbedtls_rsa_pkcs1_encrypt',\ +mbedtls_rsa_pkcs1_sign,'mbedtls_rsa_pkcs1_sign',\ +mbedtls_rsa_pkcs1_verify,'mbedtls_rsa_pkcs1_verify',\ +mbedtls_rsa_private,'mbedtls_rsa_private',\ +mbedtls_rsa_public,'mbedtls_rsa_public',\ +mbedtls_rsa_rsaes_oaep_decrypt,'mbedtls_rsa_rsaes_oaep_decrypt',\ +mbedtls_rsa_rsaes_oaep_encrypt,'mbedtls_rsa_rsaes_oaep_encrypt',\ +mbedtls_rsa_rsaes_pkcs1_v15_decrypt,'mbedtls_rsa_rsaes_pkcs1_v15_decrypt',\ +mbedtls_rsa_rsaes_pkcs1_v15_encrypt,'mbedtls_rsa_rsaes_pkcs1_v15_encrypt',\ +mbedtls_rsa_rsassa_pkcs1_v15_sign,'mbedtls_rsa_rsassa_pkcs1_v15_sign',\ +mbedtls_rsa_rsassa_pkcs1_v15_verify,'mbedtls_rsa_rsassa_pkcs1_v15_verify',\ +mbedtls_rsa_rsassa_pss_sign,'mbedtls_rsa_rsassa_pss_sign',\ +mbedtls_rsa_rsassa_pss_verify,'mbedtls_rsa_rsassa_pss_verify',\ +mbedtls_rsa_rsassa_pss_verify_ext,'mbedtls_rsa_rsassa_pss_verify_ext',\ +mbedtls_rsa_self_test,'mbedtls_rsa_self_test',\ +mbedtls_rsa_set_padding,'mbedtls_rsa_set_padding',\ +mbedtls_rsa_validate_crt,'mbedtls_rsa_validate_crt',\ +mbedtls_rsa_validate_params,'mbedtls_rsa_validate_params',\ +mbedtls_sha1,'mbedtls_sha1',\ +mbedtls_sha1_clone,'mbedtls_sha1_clone',\ +mbedtls_sha1_finish,'mbedtls_sha1_finish',\ +mbedtls_sha1_finish_ret,'mbedtls_sha1_finish_ret',\ +mbedtls_sha1_free,'mbedtls_sha1_free',\ +mbedtls_sha1_init,'mbedtls_sha1_init',\ +mbedtls_sha1_process,'mbedtls_sha1_process',\ +mbedtls_sha1_ret,'mbedtls_sha1_ret',\ +mbedtls_sha1_self_test,'mbedtls_sha1_self_test',\ +mbedtls_sha1_starts,'mbedtls_sha1_starts',\ +mbedtls_sha1_starts_ret,'mbedtls_sha1_starts_ret',\ +mbedtls_sha1_update,'mbedtls_sha1_update',\ +mbedtls_sha1_update_ret,'mbedtls_sha1_update_ret',\ +mbedtls_sha256,'mbedtls_sha256',\ +mbedtls_sha256_clone,'mbedtls_sha256_clone',\ +mbedtls_sha256_finish,'mbedtls_sha256_finish',\ +mbedtls_sha256_finish_ret,'mbedtls_sha256_finish_ret',\ +mbedtls_sha256_free,'mbedtls_sha256_free',\ +mbedtls_sha256_init,'mbedtls_sha256_init',\ +mbedtls_sha256_process,'mbedtls_sha256_process',\ +mbedtls_sha256_ret,'mbedtls_sha256_ret',\ +mbedtls_sha256_self_test,'mbedtls_sha256_self_test',\ +mbedtls_sha256_starts,'mbedtls_sha256_starts',\ +mbedtls_sha256_starts_ret,'mbedtls_sha256_starts_ret',\ +mbedtls_sha256_update,'mbedtls_sha256_update',\ +mbedtls_sha256_update_ret,'mbedtls_sha256_update_ret',\ +mbedtls_sha512,'mbedtls_sha512',\ +mbedtls_sha512_clone,'mbedtls_sha512_clone',\ +mbedtls_sha512_finish,'mbedtls_sha512_finish',\ +mbedtls_sha512_finish_ret,'mbedtls_sha512_finish_ret',\ +mbedtls_sha512_free,'mbedtls_sha512_free',\ +mbedtls_sha512_init,'mbedtls_sha512_init',\ +mbedtls_sha512_process,'mbedtls_sha512_process',\ +mbedtls_sha512_ret,'mbedtls_sha512_ret',\ +mbedtls_sha512_self_test,'mbedtls_sha512_self_test',\ +mbedtls_sha512_starts,'mbedtls_sha512_starts',\ +mbedtls_sha512_starts_ret,'mbedtls_sha512_starts_ret',\ +mbedtls_sha512_update,'mbedtls_sha512_update',\ +mbedtls_sha512_update_ret,'mbedtls_sha512_update_ret',\ +mbedtls_ssl_cache_free,'mbedtls_ssl_cache_free',\ +mbedtls_ssl_cache_get,'mbedtls_ssl_cache_get',\ +mbedtls_ssl_cache_init,'mbedtls_ssl_cache_init',\ +mbedtls_ssl_cache_set,'mbedtls_ssl_cache_set',\ +mbedtls_ssl_cache_set_max_entries,'mbedtls_ssl_cache_set_max_entries',\ +mbedtls_ssl_cache_set_timeout,'mbedtls_ssl_cache_set_timeout',\ +mbedtls_ssl_check_cert_usage,'mbedtls_ssl_check_cert_usage',\ +mbedtls_ssl_check_curve,'mbedtls_ssl_check_curve',\ +mbedtls_ssl_check_pending,'mbedtls_ssl_check_pending',\ +mbedtls_ssl_check_sig_hash,'mbedtls_ssl_check_sig_hash',\ +mbedtls_ssl_ciphersuite_from_id,'mbedtls_ssl_ciphersuite_from_id',\ +mbedtls_ssl_ciphersuite_from_string,'mbedtls_ssl_ciphersuite_from_string',\ +mbedtls_ssl_ciphersuite_uses_ec,'mbedtls_ssl_ciphersuite_uses_ec',\ +mbedtls_ssl_ciphersuite_uses_psk,'mbedtls_ssl_ciphersuite_uses_psk',\ +mbedtls_ssl_close_notify,'mbedtls_ssl_close_notify',\ +mbedtls_ssl_conf_alpn_protocols,'mbedtls_ssl_conf_alpn_protocols',\ +mbedtls_ssl_conf_arc4_support,'mbedtls_ssl_conf_arc4_support',\ +mbedtls_ssl_conf_authmode,'mbedtls_ssl_conf_authmode',\ +mbedtls_ssl_conf_ca_chain,'mbedtls_ssl_conf_ca_chain',\ +mbedtls_ssl_conf_cbc_record_splitting,'mbedtls_ssl_conf_cbc_record_splitting',\ +mbedtls_ssl_conf_cert_profile,'mbedtls_ssl_conf_cert_profile',\ +mbedtls_ssl_conf_cert_req_ca_list,'mbedtls_ssl_conf_cert_req_ca_list',\ +mbedtls_ssl_conf_ciphersuites,'mbedtls_ssl_conf_ciphersuites',\ +mbedtls_ssl_conf_ciphersuites_for_version,'mbedtls_ssl_conf_ciphersuites_for_version',\ +mbedtls_ssl_conf_curves,'mbedtls_ssl_conf_curves',\ +mbedtls_ssl_conf_dbg,'mbedtls_ssl_conf_dbg',\ +mbedtls_ssl_conf_dhm_min_bitlen,'mbedtls_ssl_conf_dhm_min_bitlen',\ +mbedtls_ssl_conf_dh_param,'mbedtls_ssl_conf_dh_param',\ +mbedtls_ssl_conf_dh_param_bin,'mbedtls_ssl_conf_dh_param_bin',\ +mbedtls_ssl_conf_dh_param_ctx,'mbedtls_ssl_conf_dh_param_ctx',\ +mbedtls_ssl_conf_dtls_anti_replay,'mbedtls_ssl_conf_dtls_anti_replay',\ +mbedtls_ssl_conf_dtls_badmac_limit,'mbedtls_ssl_conf_dtls_badmac_limit',\ +mbedtls_ssl_conf_dtls_cookies,'mbedtls_ssl_conf_dtls_cookies',\ +mbedtls_ssl_conf_encrypt_then_mac,'mbedtls_ssl_conf_encrypt_then_mac',\ +mbedtls_ssl_conf_endpoint,'mbedtls_ssl_conf_endpoint',\ +mbedtls_ssl_conf_export_keys_cb,'mbedtls_ssl_conf_export_keys_cb',\ +mbedtls_ssl_conf_extended_master_secret,'mbedtls_ssl_conf_extended_master_secret',\ +mbedtls_ssl_conf_fallback,'mbedtls_ssl_conf_fallback',\ +mbedtls_ssl_conf_handshake_timeout,'mbedtls_ssl_conf_handshake_timeout',\ +mbedtls_ssl_config_defaults,'mbedtls_ssl_config_defaults',\ +mbedtls_ssl_config_free,'mbedtls_ssl_config_free',\ +mbedtls_ssl_config_init,'mbedtls_ssl_config_init',\ +mbedtls_ssl_conf_legacy_renegotiation,'mbedtls_ssl_conf_legacy_renegotiation',\ +mbedtls_ssl_conf_max_frag_len,'mbedtls_ssl_conf_max_frag_len',\ +mbedtls_ssl_conf_max_version,'mbedtls_ssl_conf_max_version',\ +mbedtls_ssl_conf_min_version,'mbedtls_ssl_conf_min_version',\ +mbedtls_ssl_conf_own_cert,'mbedtls_ssl_conf_own_cert',\ +mbedtls_ssl_conf_psk,'mbedtls_ssl_conf_psk',\ +mbedtls_ssl_conf_psk_cb,'mbedtls_ssl_conf_psk_cb',\ +mbedtls_ssl_conf_read_timeout,'mbedtls_ssl_conf_read_timeout',\ +mbedtls_ssl_conf_renegotiation,'mbedtls_ssl_conf_renegotiation',\ +mbedtls_ssl_conf_renegotiation_enforced,'mbedtls_ssl_conf_renegotiation_enforced',\ +mbedtls_ssl_conf_renegotiation_period,'mbedtls_ssl_conf_renegotiation_period',\ +mbedtls_ssl_conf_rng,'mbedtls_ssl_conf_rng',\ +mbedtls_ssl_conf_session_cache,'mbedtls_ssl_conf_session_cache',\ +mbedtls_ssl_conf_session_tickets,'mbedtls_ssl_conf_session_tickets',\ +mbedtls_ssl_conf_session_tickets_cb,'mbedtls_ssl_conf_session_tickets_cb',\ +mbedtls_ssl_conf_sig_hashes,'mbedtls_ssl_conf_sig_hashes',\ +mbedtls_ssl_conf_sni,'mbedtls_ssl_conf_sni',\ +mbedtls_ssl_conf_transport,'mbedtls_ssl_conf_transport',\ +mbedtls_ssl_conf_truncated_hmac,'mbedtls_ssl_conf_truncated_hmac',\ +mbedtls_ssl_conf_verify,'mbedtls_ssl_conf_verify',\ +mbedtls_ssl_cookie_check,'mbedtls_ssl_cookie_check',\ +mbedtls_ssl_cookie_free,'mbedtls_ssl_cookie_free',\ +mbedtls_ssl_cookie_init,'mbedtls_ssl_cookie_init',\ +mbedtls_ssl_cookie_set_timeout,'mbedtls_ssl_cookie_set_timeout',\ +mbedtls_ssl_cookie_setup,'mbedtls_ssl_cookie_setup',\ +mbedtls_ssl_cookie_write,'mbedtls_ssl_cookie_write',\ +mbedtls_ssl_derive_keys,'mbedtls_ssl_derive_keys',\ +mbedtls_ssl_dtls_replay_check,'mbedtls_ssl_dtls_replay_check',\ +mbedtls_ssl_dtls_replay_update,'mbedtls_ssl_dtls_replay_update',\ +mbedtls_ssl_fetch_input,'mbedtls_ssl_fetch_input',\ +mbedtls_ssl_flight_transmit,'mbedtls_ssl_flight_transmit',\ +mbedtls_ssl_flush_output,'mbedtls_ssl_flush_output',\ +mbedtls_ssl_free,'mbedtls_ssl_free',\ +mbedtls_ssl_get_alpn_protocol,'mbedtls_ssl_get_alpn_protocol',\ +mbedtls_ssl_get_bytes_avail,'mbedtls_ssl_get_bytes_avail',\ +mbedtls_ssl_get_ciphersuite,'mbedtls_ssl_get_ciphersuite',\ +mbedtls_ssl_get_ciphersuite_id,'mbedtls_ssl_get_ciphersuite_id',\ +mbedtls_ssl_get_ciphersuite_name,'mbedtls_ssl_get_ciphersuite_name',\ +mbedtls_ssl_get_ciphersuite_sig_alg,'mbedtls_ssl_get_ciphersuite_sig_alg',\ +mbedtls_ssl_get_ciphersuite_sig_pk_alg,'mbedtls_ssl_get_ciphersuite_sig_pk_alg',\ +mbedtls_ssl_get_key_exchange_md_ssl_tls,'mbedtls_ssl_get_key_exchange_md_ssl_tls',\ +mbedtls_ssl_get_key_exchange_md_tls1_2,'mbedtls_ssl_get_key_exchange_md_tls1_2',\ +mbedtls_ssl_get_max_frag_len,'mbedtls_ssl_get_max_frag_len',\ +mbedtls_ssl_get_max_out_record_payload,'mbedtls_ssl_get_max_out_record_payload',\ +mbedtls_ssl_get_peer_cert,'mbedtls_ssl_get_peer_cert',\ +mbedtls_ssl_get_record_expansion,'mbedtls_ssl_get_record_expansion',\ +mbedtls_ssl_get_session,'mbedtls_ssl_get_session',\ +mbedtls_ssl_get_verify_result,'mbedtls_ssl_get_verify_result',\ +mbedtls_ssl_get_version,'mbedtls_ssl_get_version',\ +mbedtls_ssl_handle_message_type,'mbedtls_ssl_handle_message_type',\ +mbedtls_ssl_handshake,'mbedtls_ssl_handshake',\ +mbedtls_ssl_handshake_client_step,'mbedtls_ssl_handshake_client_step',\ +mbedtls_ssl_handshake_free,'mbedtls_ssl_handshake_free',\ +mbedtls_ssl_handshake_server_step,'mbedtls_ssl_handshake_server_step',\ +mbedtls_ssl_handshake_step,'mbedtls_ssl_handshake_step',\ +mbedtls_ssl_handshake_wrapup,'mbedtls_ssl_handshake_wrapup',\ +mbedtls_ssl_hash_from_md_alg,'mbedtls_ssl_hash_from_md_alg',\ +mbedtls_ssl_init,'mbedtls_ssl_init',\ +mbedtls_ssl_list_ciphersuites,'mbedtls_ssl_list_ciphersuites',\ +mbedtls_ssl_md_alg_from_hash,'mbedtls_ssl_md_alg_from_hash',\ +mbedtls_ssl_optimize_checksum,'mbedtls_ssl_optimize_checksum',\ +mbedtls_ssl_parse_certificate,'mbedtls_ssl_parse_certificate',\ +mbedtls_ssl_parse_change_cipher_spec,'mbedtls_ssl_parse_change_cipher_spec',\ +mbedtls_ssl_parse_finished,'mbedtls_ssl_parse_finished',\ +mbedtls_ssl_pk_alg_from_sig,'mbedtls_ssl_pk_alg_from_sig',\ +mbedtls_ssl_prepare_handshake_record,'mbedtls_ssl_prepare_handshake_record',\ +mbedtls_ssl_psk_derive_premaster,'mbedtls_ssl_psk_derive_premaster',\ +mbedtls_ssl_read,'mbedtls_ssl_read',\ +mbedtls_ssl_read_record,'mbedtls_ssl_read_record',\ +mbedtls_ssl_read_version,'mbedtls_ssl_read_version',\ +mbedtls_ssl_recv_flight_completed,'mbedtls_ssl_recv_flight_completed',\ +mbedtls_ssl_renegotiate,'mbedtls_ssl_renegotiate',\ +mbedtls_ssl_resend,'mbedtls_ssl_resend',\ +mbedtls_ssl_reset_checksum,'mbedtls_ssl_reset_checksum',\ +mbedtls_ssl_send_alert_message,'mbedtls_ssl_send_alert_message',\ +mbedtls_ssl_send_fatal_handshake_failure,'mbedtls_ssl_send_fatal_handshake_failure',\ +mbedtls_ssl_send_flight_completed,'mbedtls_ssl_send_flight_completed',\ +mbedtls_ssl_session_free,'mbedtls_ssl_session_free',\ +mbedtls_ssl_session_init,'mbedtls_ssl_session_init',\ +mbedtls_ssl_session_reset,'mbedtls_ssl_session_reset',\ +mbedtls_ssl_set_bio,'mbedtls_ssl_set_bio',\ +mbedtls_ssl_set_calc_verify_md,'mbedtls_ssl_set_calc_verify_md',\ +mbedtls_ssl_set_client_transport_id,'mbedtls_ssl_set_client_transport_id',\ +mbedtls_ssl_set_datagram_packing,'mbedtls_ssl_set_datagram_packing',\ +mbedtls_ssl_set_hostname,'mbedtls_ssl_set_hostname',\ +mbedtls_ssl_set_hs_authmode,'mbedtls_ssl_set_hs_authmode',\ +mbedtls_ssl_set_hs_ca_chain,'mbedtls_ssl_set_hs_ca_chain',\ +mbedtls_ssl_set_hs_own_cert,'mbedtls_ssl_set_hs_own_cert',\ +mbedtls_ssl_set_hs_psk,'mbedtls_ssl_set_hs_psk',\ +mbedtls_ssl_set_mtu,'mbedtls_ssl_set_mtu',\ +mbedtls_ssl_set_session,'mbedtls_ssl_set_session',\ +mbedtls_ssl_set_timer_cb,'mbedtls_ssl_set_timer_cb',\ +mbedtls_ssl_setup,'mbedtls_ssl_setup',\ +mbedtls_ssl_sig_from_pk,'mbedtls_ssl_sig_from_pk',\ +mbedtls_ssl_sig_from_pk_alg,'mbedtls_ssl_sig_from_pk_alg',\ +mbedtls_ssl_sig_hash_set_add,'mbedtls_ssl_sig_hash_set_add',\ +mbedtls_ssl_sig_hash_set_const_hash,'mbedtls_ssl_sig_hash_set_const_hash',\ +mbedtls_ssl_sig_hash_set_find,'mbedtls_ssl_sig_hash_set_find',\ +mbedtls_ssl_ticket_free,'mbedtls_ssl_ticket_free',\ +mbedtls_ssl_ticket_init,'mbedtls_ssl_ticket_init',\ +mbedtls_ssl_ticket_parse,'mbedtls_ssl_ticket_parse',\ +mbedtls_ssl_ticket_setup,'mbedtls_ssl_ticket_setup',\ +mbedtls_ssl_ticket_write,'mbedtls_ssl_ticket_write',\ +mbedtls_ssl_transform_free,'mbedtls_ssl_transform_free',\ +mbedtls_ssl_update_handshake_status,'mbedtls_ssl_update_handshake_status',\ +mbedtls_ssl_write,'mbedtls_ssl_write',\ +mbedtls_ssl_write_certificate,'mbedtls_ssl_write_certificate',\ +mbedtls_ssl_write_change_cipher_spec,'mbedtls_ssl_write_change_cipher_spec',\ +mbedtls_ssl_write_finished,'mbedtls_ssl_write_finished',\ +mbedtls_ssl_write_handshake_msg,'mbedtls_ssl_write_handshake_msg',\ +mbedtls_ssl_write_record,'mbedtls_ssl_write_record',\ +mbedtls_ssl_write_version,'mbedtls_ssl_write_version',\ +mbedtls_strerror,'mbedtls_strerror',\ +mbedtls_sysfn_14_poll,'mbedtls_sysfn_14_poll',\ +mbedtls_sysfn_18_4_poll,'mbedtls_sysfn_18_4_poll',\ +mbedtls_sysfn_26_9_poll,'mbedtls_sysfn_26_9_poll',\ +mbedtls_sysfn_37_0_poll,'mbedtls_sysfn_37_0_poll',\ +mbedtls_sysfn_3_poll,'mbedtls_sysfn_3_poll',\ +mbedtls_sysfn_66_3_poll,'mbedtls_sysfn_66_3_poll',\ +mbedtls_sysfn_68_0_poll,'mbedtls_sysfn_68_0_poll',\ +mbedtls_version_check_feature,'mbedtls_version_check_feature',\ +mbedtls_version_get_number,'mbedtls_version_get_number',\ +mbedtls_version_get_string,'mbedtls_version_get_string',\ +mbedtls_version_get_string_full,'mbedtls_version_get_string_full',\ +mbedtls_x509_crl_free,'mbedtls_x509_crl_free',\ +mbedtls_x509_crl_info,'mbedtls_x509_crl_info',\ +mbedtls_x509_crl_init,'mbedtls_x509_crl_init',\ +mbedtls_x509_crl_parse,'mbedtls_x509_crl_parse',\ +mbedtls_x509_crl_parse_der,'mbedtls_x509_crl_parse_der',\ +mbedtls_x509_crt_check_extended_key_usage,'mbedtls_x509_crt_check_extended_key_usage',\ +mbedtls_x509_crt_check_key_usage,'mbedtls_x509_crt_check_key_usage',\ +mbedtls_x509_crt_free,'mbedtls_x509_crt_free',\ +mbedtls_x509_crt_info,'mbedtls_x509_crt_info',\ +mbedtls_x509_crt_init,'mbedtls_x509_crt_init',\ +mbedtls_x509_crt_is_revoked,'mbedtls_x509_crt_is_revoked',\ +mbedtls_x509_crt_parse,'mbedtls_x509_crt_parse',\ +mbedtls_x509_crt_parse_der,'mbedtls_x509_crt_parse_der',\ +mbedtls_x509_crt_verify,'mbedtls_x509_crt_verify',\ +mbedtls_x509_crt_verify_info,'mbedtls_x509_crt_verify_info',\ +mbedtls_x509_crt_verify_restartable,'mbedtls_x509_crt_verify_restartable',\ +mbedtls_x509_crt_verify_with_profile,'mbedtls_x509_crt_verify_with_profile',\ +mbedtls_x509_csr_free,'mbedtls_x509_csr_free',\ +mbedtls_x509_csr_info,'mbedtls_x509_csr_info',\ +mbedtls_x509_csr_init,'mbedtls_x509_csr_init',\ +mbedtls_x509_csr_parse,'mbedtls_x509_csr_parse',\ +mbedtls_x509_csr_parse_der,'mbedtls_x509_csr_parse_der',\ +mbedtls_x509_dn_gets,'mbedtls_x509_dn_gets',\ +mbedtls_x509_get_alg,'mbedtls_x509_get_alg',\ +mbedtls_x509_get_alg_null,'mbedtls_x509_get_alg_null',\ +mbedtls_x509_get_ext,'mbedtls_x509_get_ext',\ +mbedtls_x509_get_name,'mbedtls_x509_get_name',\ +mbedtls_x509_get_rsassa_pss_params,'mbedtls_x509_get_rsassa_pss_params',\ +mbedtls_x509_get_serial,'mbedtls_x509_get_serial',\ +mbedtls_x509_get_sig,'mbedtls_x509_get_sig',\ +mbedtls_x509_get_sig_alg,'mbedtls_x509_get_sig_alg',\ +mbedtls_x509_get_time,'mbedtls_x509_get_time',\ +mbedtls_x509_key_size_helper,'mbedtls_x509_key_size_helper',\ +mbedtls_x509_self_test,'mbedtls_x509_self_test',\ +mbedtls_x509_serial_gets,'mbedtls_x509_serial_gets',\ +mbedtls_x509_set_extension,'mbedtls_x509_set_extension',\ +mbedtls_x509_sig_alg_gets,'mbedtls_x509_sig_alg_gets',\ +mbedtls_x509_string_to_names,'mbedtls_x509_string_to_names',\ +mbedtls_x509_time_is_future,'mbedtls_x509_time_is_future',\ +mbedtls_x509_time_is_past,'mbedtls_x509_time_is_past',\ +mbedtls_x509write_crt_der,'mbedtls_x509write_crt_der',\ +mbedtls_x509write_crt_free,'mbedtls_x509write_crt_free',\ +mbedtls_x509write_crt_init,'mbedtls_x509write_crt_init',\ +mbedtls_x509write_crt_pem,'mbedtls_x509write_crt_pem',\ +mbedtls_x509write_crt_set_authority_key_identifier,'mbedtls_x509write_crt_set_authority_key_identifier',\ +mbedtls_x509write_crt_set_basic_constraints,'mbedtls_x509write_crt_set_basic_constraints',\ +mbedtls_x509write_crt_set_extension,'mbedtls_x509write_crt_set_extension',\ +mbedtls_x509write_crt_set_issuer_key,'mbedtls_x509write_crt_set_issuer_key',\ +mbedtls_x509write_crt_set_issuer_name,'mbedtls_x509write_crt_set_issuer_name',\ +mbedtls_x509write_crt_set_key_usage,'mbedtls_x509write_crt_set_key_usage',\ +mbedtls_x509write_crt_set_md_alg,'mbedtls_x509write_crt_set_md_alg',\ +mbedtls_x509write_crt_set_ns_cert_type,'mbedtls_x509write_crt_set_ns_cert_type',\ +mbedtls_x509write_crt_set_serial,'mbedtls_x509write_crt_set_serial',\ +mbedtls_x509write_crt_set_subject_key,'mbedtls_x509write_crt_set_subject_key',\ +mbedtls_x509write_crt_set_subject_key_identifier,'mbedtls_x509write_crt_set_subject_key_identifier',\ +mbedtls_x509write_crt_set_subject_name,'mbedtls_x509write_crt_set_subject_name',\ +mbedtls_x509write_crt_set_validity,'mbedtls_x509write_crt_set_validity',\ +mbedtls_x509write_crt_set_version,'mbedtls_x509write_crt_set_version',\ +mbedtls_x509write_csr_der,'mbedtls_x509write_csr_der',\ +mbedtls_x509write_csr_free,'mbedtls_x509write_csr_free',\ +mbedtls_x509write_csr_init,'mbedtls_x509write_csr_init',\ +mbedtls_x509write_csr_pem,'mbedtls_x509write_csr_pem',\ +mbedtls_x509write_csr_set_extension,'mbedtls_x509write_csr_set_extension',\ +mbedtls_x509write_csr_set_key,'mbedtls_x509write_csr_set_key',\ +mbedtls_x509write_csr_set_key_usage,'mbedtls_x509write_csr_set_key_usage',\ +mbedtls_x509write_csr_set_md_alg,'mbedtls_x509write_csr_set_md_alg',\ +mbedtls_x509write_csr_set_ns_cert_type,'mbedtls_x509write_csr_set_ns_cert_type',\ +mbedtls_x509write_csr_set_subject_name,'mbedtls_x509write_csr_set_subject_name',\ +mbedtls_x509_write_extensions,'mbedtls_x509_write_extensions',\ +mbedtls_x509_write_names,'mbedtls_x509_write_names',\ +mbedtls_x509_write_sig,'mbedtls_x509_write_sig',\ +mbedtls_xtea_crypt_cbc,'mbedtls_xtea_crypt_cbc',\ +mbedtls_xtea_crypt_ecb,'mbedtls_xtea_crypt_ecb',\ +mbedtls_xtea_free,'mbedtls_xtea_free',\ +mbedtls_xtea_init,'mbedtls_xtea_init',\ +mbedtls_xtea_self_test,'mbedtls_xtea_self_test',\ +mbedtls_xtea_setup,'mbedtls_xtea_setup', \ +mbedtls_test_cas_pem, 'mbedtls_test_cas_pem', \ +mbedtls_test_cas_pem_len, 'mbedtls_test_cas_pem_len' diff --git a/programs/develop/libraries/kos_mbedtls/library/libtcc/___chkstk_ms.c b/programs/develop/libraries/kos_mbedtls/library/libtcc/___chkstk_ms.c new file mode 100644 index 0000000000..c446841ab4 --- /dev/null +++ b/programs/develop/libraries/kos_mbedtls/library/libtcc/___chkstk_ms.c @@ -0,0 +1 @@ +void ___chkstk_ms() {} \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/library/libtcc/libtcc1.c b/programs/develop/libraries/kos_mbedtls/library/libtcc/libtcc1.c new file mode 100644 index 0000000000..e67ea59ea5 --- /dev/null +++ b/programs/develop/libraries/kos_mbedtls/library/libtcc/libtcc1.c @@ -0,0 +1,763 @@ +/* TCC runtime library. + Parts of this code are (c) 2002 Fabrice Bellard + + Copyright (C) 1987, 1988, 1992, 1994, 1995 Free Software Foundation, Inc. + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +This file is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + +//#include +#define TCC_TARGET_I386 + +#define W_TYPE_SIZE 32 +#define BITS_PER_UNIT 8 + +typedef int Wtype; +typedef unsigned int UWtype; +typedef unsigned int USItype; +typedef long long DWtype; +typedef unsigned long long UDWtype; + +struct DWstruct { + Wtype low, high; +}; + +typedef union +{ + struct DWstruct s; + DWtype ll; +} DWunion; + +typedef long double XFtype; +#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT) +#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE) + +/* the following deal with IEEE single-precision numbers */ +#define EXCESS 126 +#define SIGNBIT 0x80000000 +#define HIDDEN (1 << 23) +#define SIGN(fp) ((fp) & SIGNBIT) +#define EXP(fp) (((fp) >> 23) & 0xFF) +#define MANT(fp) (((fp) & 0x7FFFFF) | HIDDEN) +#define PACK(s,e,m) ((s) | ((e) << 23) | (m)) + +/* the following deal with IEEE double-precision numbers */ +#define EXCESSD 1022 +#define HIDDEND (1 << 20) +#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF) +#define SIGND(fp) ((fp.l.upper) & SIGNBIT) +#define MANTD(fp) (((((fp.l.upper) & 0xFFFFF) | HIDDEND) << 10) | \ + (fp.l.lower >> 22)) +#define HIDDEND_LL ((long long)1 << 52) +#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL) +#define PACKD_LL(s,e,m) (((long long)((s)+((e)<<20))<<32)|(m)) + +/* the following deal with x86 long double-precision numbers */ +#define EXCESSLD 16382 +#define EXPLD(fp) (fp.l.upper & 0x7fff) +#define SIGNLD(fp) ((fp.l.upper) & 0x8000) + +/* only for x86 */ +union ldouble_long { + long double ld; + struct { + unsigned long long lower; + unsigned short upper; + } l; +}; + +union double_long { + double d; +#if 1 + struct { + unsigned int lower; + int upper; + } l; +#else + struct { + int upper; + unsigned int lower; + } l; +#endif + long long ll; +}; + +union float_long { + float f; + unsigned int l; +}; + +/* XXX: we don't support several builtin supports for now */ +#if !defined(TCC_TARGET_X86_64) && !defined(TCC_TARGET_ARM) + +/* XXX: use gcc/tcc intrinsic ? */ +#if defined(TCC_TARGET_I386) +#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ + __asm__ ("subl %5,%1\n\tsbbl %3,%0" \ + : "=r" ((USItype) (sh)), \ + "=&r" ((USItype) (sl)) \ + : "0" ((USItype) (ah)), \ + "g" ((USItype) (bh)), \ + "1" ((USItype) (al)), \ + "g" ((USItype) (bl))) +#define umul_ppmm(w1, w0, u, v) \ + __asm__ ("mull %3" \ + : "=a" ((USItype) (w0)), \ + "=d" ((USItype) (w1)) \ + : "%0" ((USItype) (u)), \ + "rm" ((USItype) (v))) +#define udiv_qrnnd(q, r, n1, n0, dv) \ + __asm__ ("divl %4" \ + : "=a" ((USItype) (q)), \ + "=d" ((USItype) (r)) \ + : "0" ((USItype) (n0)), \ + "1" ((USItype) (n1)), \ + "rm" ((USItype) (dv))) +#define count_leading_zeros(count, x) \ + do { \ + USItype __cbtmp; \ + __asm__ ("bsrl %1,%0" \ + : "=r" (__cbtmp) : "rm" ((USItype) (x))); \ + (count) = __cbtmp ^ 31; \ + } while (0) +#else +#error unsupported CPU type +#endif + +/* most of this code is taken from libgcc2.c from gcc */ +UDWtype __udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp) +{ + DWunion ww; + DWunion nn, dd; + DWunion rr; + UWtype d0, d1, n0, n1, n2; + UWtype q0, q1; + UWtype b, bm; + + nn.ll = n; + dd.ll = d; + + d0 = dd.s.low; + d1 = dd.s.high; + n0 = nn.s.low; + n1 = nn.s.high; + +#if !defined(UDIV_NEEDS_NORMALIZATION) + if (d1 == 0) + { + if (d0 > n1) + { + /* 0q = nn / 0D */ + + udiv_qrnnd (q0, n0, n1, n0, d0); + q1 = 0; + + /* Remainder in n0. */ + } + else + { + /* qq = NN / 0d */ + + if (d0 == 0) + d0 = 1 / d0; /* Divide intentionally by zero. */ + + udiv_qrnnd (q1, n1, 0, n1, d0); + udiv_qrnnd (q0, n0, n1, n0, d0); + + /* Remainder in n0. */ + } + + if (rp != 0) + { + rr.s.low = n0; + rr.s.high = 0; + *rp = rr.ll; + } + } + +#else /* UDIV_NEEDS_NORMALIZATION */ + + if (d1 == 0) + { + if (d0 > n1) + { + /* 0q = nn / 0D */ + + count_leading_zeros (bm, d0); + + if (bm != 0) + { + /* Normalize, i.e. make the most significant bit of the + denominator set. */ + + d0 = d0 << bm; + n1 = (n1 << bm) | (n0 >> (W_TYPE_SIZE - bm)); + n0 = n0 << bm; + } + + udiv_qrnnd (q0, n0, n1, n0, d0); + q1 = 0; + + /* Remainder in n0 >> bm. */ + } + else + { + /* qq = NN / 0d */ + + if (d0 == 0) + d0 = 1 / d0; /* Divide intentionally by zero. */ + + count_leading_zeros (bm, d0); + + if (bm == 0) + { + /* From (n1 >= d0) /\ (the most significant bit of d0 is set), + conclude (the most significant bit of n1 is set) /\ (the + leading quotient digit q1 = 1). + + This special case is necessary, not an optimization. + (Shifts counts of W_TYPE_SIZE are undefined.) */ + + n1 -= d0; + q1 = 1; + } + else + { + /* Normalize. */ + + b = W_TYPE_SIZE - bm; + + d0 = d0 << bm; + n2 = n1 >> b; + n1 = (n1 << bm) | (n0 >> b); + n0 = n0 << bm; + + udiv_qrnnd (q1, n1, n2, n1, d0); + } + + /* n1 != d0... */ + + udiv_qrnnd (q0, n0, n1, n0, d0); + + /* Remainder in n0 >> bm. */ + } + + if (rp != 0) + { + rr.s.low = n0 >> bm; + rr.s.high = 0; + *rp = rr.ll; + } + } +#endif /* UDIV_NEEDS_NORMALIZATION */ + + else + { + if (d1 > n1) + { + /* 00 = nn / DD */ + + q0 = 0; + q1 = 0; + + /* Remainder in n1n0. */ + if (rp != 0) + { + rr.s.low = n0; + rr.s.high = n1; + *rp = rr.ll; + } + } + else + { + /* 0q = NN / dd */ + + count_leading_zeros (bm, d1); + if (bm == 0) + { + /* From (n1 >= d1) /\ (the most significant bit of d1 is set), + conclude (the most significant bit of n1 is set) /\ (the + quotient digit q0 = 0 or 1). + + This special case is necessary, not an optimization. */ + + /* The condition on the next line takes advantage of that + n1 >= d1 (true due to program flow). */ + if (n1 > d1 || n0 >= d0) + { + q0 = 1; + sub_ddmmss (n1, n0, n1, n0, d1, d0); + } + else + q0 = 0; + + q1 = 0; + + if (rp != 0) + { + rr.s.low = n0; + rr.s.high = n1; + *rp = rr.ll; + } + } + else + { + UWtype m1, m0; + /* Normalize. */ + + b = W_TYPE_SIZE - bm; + + d1 = (d1 << bm) | (d0 >> b); + d0 = d0 << bm; + n2 = n1 >> b; + n1 = (n1 << bm) | (n0 >> b); + n0 = n0 << bm; + + udiv_qrnnd (q0, n1, n2, n1, d1); + umul_ppmm (m1, m0, q0, d0); + + if (m1 > n1 || (m1 == n1 && m0 > n0)) + { + q0--; + sub_ddmmss (m1, m0, m1, m0, d1, d0); + } + + q1 = 0; + + /* Remainder in (n1n0 - m1m0) >> bm. */ + if (rp != 0) + { + sub_ddmmss (n1, n0, n1, n0, m1, m0); + rr.s.low = (n1 << b) | (n0 >> bm); + rr.s.high = n1 >> bm; + *rp = rr.ll; + } + } + } + } + + ww.s.low = q0; + ww.s.high = q1; + return ww.ll; +} + +#define __negdi2(a) (-(a)) + +long long __divdi3(long long u, long long v) +{ + int c = 0; + DWunion uu, vv; + DWtype w; + + uu.ll = u; + vv.ll = v; + + if (uu.s.high < 0) { + c = ~c; + uu.ll = __negdi2 (uu.ll); + } + if (vv.s.high < 0) { + c = ~c; + vv.ll = __negdi2 (vv.ll); + } + w = __udivmoddi4 (uu.ll, vv.ll, (UDWtype *) 0); + if (c) + w = __negdi2 (w); + return w; +} + +// https://github.com/KaMeHb-UA/UE4m/blob/1d9ad5bfead06520570c7f24dad062f9f8717c1a/\ +Engine/Extras/ThirdPartyNotUE/emsdk/emscripten/incoming/system/lib/compiler-rt/lib/\ +builtins/divmoddi4.c +long long __divmoddi4(long long a, long long b, long long* rem) +{ + long long d = __divdi3(a, b); + *rem = a - (d * b); + return d; +} + +long long __moddi3(long long u, long long v) +{ + int c = 0; + DWunion uu, vv; + DWtype w; + + uu.ll = u; + vv.ll = v; + + if (uu.s.high < 0) { + c = ~c; + uu.ll = __negdi2 (uu.ll); + } + if (vv.s.high < 0) + vv.ll = __negdi2 (vv.ll); + + __udivmoddi4 (uu.ll, vv.ll, (UDWtype *) &w); + if (c) + w = __negdi2 (w); + return w; +} + +unsigned long long __udivdi3(unsigned long long u, unsigned long long v) +{ + return __udivmoddi4 (u, v, (UDWtype *) 0); +} + +unsigned long long __umoddi3(unsigned long long u, unsigned long long v) +{ + UDWtype w; + + __udivmoddi4 (u, v, &w); + return w; +} + +/* XXX: fix tcc's code generator to do this instead */ +long long __ashrdi3(long long a, int b) +{ +#ifdef __TINYC__ + DWunion u; + u.ll = a; + if (b >= 32) { + u.s.low = u.s.high >> (b - 32); + u.s.high = u.s.high >> 31; + } else if (b != 0) { + u.s.low = ((unsigned)u.s.low >> b) | (u.s.high << (32 - b)); + u.s.high = u.s.high >> b; + } + return u.ll; +#else + return a >> b; +#endif +} + +/* XXX: fix tcc's code generator to do this instead */ +unsigned long long __lshrdi3(unsigned long long a, int b) +{ +#ifdef __TINYC__ + DWunion u; + u.ll = a; + if (b >= 32) { + u.s.low = (unsigned)u.s.high >> (b - 32); + u.s.high = 0; + } else if (b != 0) { + u.s.low = ((unsigned)u.s.low >> b) | (u.s.high << (32 - b)); + u.s.high = (unsigned)u.s.high >> b; + } + return u.ll; +#else + return a >> b; +#endif +} + +/* XXX: fix tcc's code generator to do this instead */ +long long __ashldi3(long long a, int b) +{ +#ifdef __TINYC__ + DWunion u; + u.ll = a; + if (b >= 32) { + u.s.high = (unsigned)u.s.low << (b - 32); + u.s.low = 0; + } else if (b != 0) { + u.s.high = ((unsigned)u.s.high << b) | ((unsigned)u.s.low >> (32 - b)); + u.s.low = (unsigned)u.s.low << b; + } + return u.ll; +#else + return a << b; +#endif +} + +#ifndef COMMIT_4ad186c5ef61_IS_FIXED +long long __tcc_cvt_ftol(long double x) +{ + unsigned c0, c1; + long long ret; + __asm__ __volatile__ ("fnstcw %0" : "=m" (c0)); + c1 = c0 | 0x0C00; + __asm__ __volatile__ ("fldcw %0" : : "m" (c1)); + __asm__ __volatile__ ("fistpll %0" : "=m" (ret)); + __asm__ __volatile__ ("fldcw %0" : : "m" (c0)); + return ret; +} +#endif + +#endif /* !__x86_64__ */ + +/* XXX: fix tcc's code generator to do this instead */ +float __floatundisf(unsigned long long a) +{ + DWunion uu; + XFtype r; + + uu.ll = a; + if (uu.s.high >= 0) { + return (float)uu.ll; + } else { + r = (XFtype)uu.ll; + r += 18446744073709551616.0; + return (float)r; + } +} + +double __floatundidf(unsigned long long a) +{ + DWunion uu; + XFtype r; + + uu.ll = a; + if (uu.s.high >= 0) { + return (double)uu.ll; + } else { + r = (XFtype)uu.ll; + r += 18446744073709551616.0; + return (double)r; + } +} + +long double __floatundixf(unsigned long long a) +{ + DWunion uu; + XFtype r; + + uu.ll = a; + if (uu.s.high >= 0) { + return (long double)uu.ll; + } else { + r = (XFtype)uu.ll; + r += 18446744073709551616.0; + return (long double)r; + } +} + +unsigned long long __fixunssfdi (float a1) +{ + register union float_long fl1; + register int exp; + register unsigned long l; + + fl1.f = a1; + + if (fl1.l == 0) + return (0); + + exp = EXP (fl1.l) - EXCESS - 24; + + l = MANT(fl1.l); + if (exp >= 41) + return (unsigned long long)-1; + else if (exp >= 0) + return (unsigned long long)l << exp; + else if (exp >= -23) + return l >> -exp; + else + return 0; +} + +unsigned long long __fixunsdfdi (double a1) +{ + register union double_long dl1; + register int exp; + register unsigned long long l; + + dl1.d = a1; + + if (dl1.ll == 0) + return (0); + + exp = EXPD (dl1) - EXCESSD - 53; + + l = MANTD_LL(dl1); + + if (exp >= 12) + return (unsigned long long)-1; + else if (exp >= 0) + return l << exp; + else if (exp >= -52) + return l >> -exp; + else + return 0; +} + +unsigned long long __fixunsxfdi (long double a1) +{ + register union ldouble_long dl1; + register int exp; + register unsigned long long l; + + dl1.ld = a1; + + if (dl1.l.lower == 0 && dl1.l.upper == 0) + return (0); + + exp = EXPLD (dl1) - EXCESSLD - 64; + + l = dl1.l.lower; + + if (exp > 0) + return (unsigned long long)-1; + else if (exp >= -63) + return l >> -exp; + else + return 0; +} + +long long __fixsfdi (float a1) +{ + long long ret; int s; + ret = __fixunssfdi((s = a1 >= 0) ? a1 : -a1); + return s ? ret : -ret; +} + +long long __fixdfdi (double a1) +{ + long long ret; int s; + ret = __fixunsdfdi((s = a1 >= 0) ? a1 : -a1); + return s ? ret : -ret; +} + +long long __fixxfdi (long double a1) +{ + long long ret; int s; + ret = __fixunsxfdi((s = a1 >= 0) ? a1 : -a1); + return s ? ret : -ret; +} + +#if defined(TCC_TARGET_X86_64) && !defined(_WIN64) + +#ifndef __TINYC__ +#include +#include +#include +#else +/* Avoid including stdlib.h because it is not easily available when + cross compiling */ +#include /* size_t definition is needed for a x86_64-tcc to parse memset() */ + void *malloc(unsigned long long); + void *memset(void *s, int c, size_t n); + void free(void*); + void abort(void); +#endif + +enum __va_arg_type { + __va_gen_reg, __va_float_reg, __va_stack +}; + +//This should be in sync with the declaration on our include/stdarg.h +/* GCC compatible definition of va_list. */ +typedef struct { + unsigned int gp_offset; + unsigned int fp_offset; + union { + unsigned int overflow_offset; + char *overflow_arg_area; + }; + char *reg_save_area; +} __va_list_struct; + +#undef __va_start +#undef __va_arg +#undef __va_copy +#undef __va_end + +void __va_start(__va_list_struct *ap, void *fp) +{ + memset(ap, 0, sizeof(__va_list_struct)); + *ap = *(__va_list_struct *)((char *)fp - 16); + ap->overflow_arg_area = (char *)fp + ap->overflow_offset; + ap->reg_save_area = (char *)fp - 176 - 16; +} + +void *__va_arg(__va_list_struct *ap, + enum __va_arg_type arg_type, + int size, int align) +{ + size = (size + 7) & ~7; + align = (align + 7) & ~7; + switch (arg_type) { + case __va_gen_reg: + if (ap->gp_offset + size <= 48) { + ap->gp_offset += size; + return ap->reg_save_area + ap->gp_offset - size; + } + goto use_overflow_area; + + case __va_float_reg: + if (ap->fp_offset < 128 + 48) { + ap->fp_offset += 16; + return ap->reg_save_area + ap->fp_offset - 16; + } + size = 8; + goto use_overflow_area; + + case __va_stack: + use_overflow_area: + ap->overflow_arg_area += size; + ap->overflow_arg_area = (char*)((intptr_t)(ap->overflow_arg_area + align - 1) & -(intptr_t)align); + return ap->overflow_arg_area - size; + + default: +#ifndef __TINYC__ + fprintf(stderr, "unknown ABI type for __va_arg\n"); +#endif + abort(); + } +} + +#endif /* __x86_64__ */ + +/* Flushing for tccrun */ +#if defined(TCC_TARGET_X86_64) || defined(TCC_TARGET_I386) + +void __clear_cache(void *beginning, void *end) +{ +} + +#elif defined(TCC_TARGET_ARM) + +#define _GNU_SOURCE +#include +#include +#include + +void __clear_cache(void *beginning, void *end) +{ +/* __ARM_NR_cacheflush is kernel private and should not be used in user space. + * However, there is no ARM asm parser in tcc so we use it for now */ +#if 1 + syscall(__ARM_NR_cacheflush, beginning, end, 0); +#else + __asm__ ("push {r7}\n\t" + "mov r7, #0xf0002\n\t" + "mov r2, #0\n\t" + "swi 0\n\t" + "pop {r7}\n\t" + "ret"); +#endif +} + +#else +#warning __clear_cache not defined for this architecture, avoid using tcc -run +#endif diff --git a/programs/develop/libraries/kos_mbedtls/library/libtcc/memcpy.c b/programs/develop/libraries/kos_mbedtls/library/libtcc/memcpy.c new file mode 100644 index 0000000000..0d707df047 --- /dev/null +++ b/programs/develop/libraries/kos_mbedtls/library/libtcc/memcpy.c @@ -0,0 +1,20 @@ +/* memcpy( void *, const void *, size_t ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include + +void * memcpy( void * s1, const void * s2, size_t n ) +{ + char * dest = ( char * ) s1; + const char * src = ( const char * ) s2; + + while ( n-- ) + { + *dest++ = *src++; + } + + return s1; +} \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/library/libtcc/memmove.c b/programs/develop/libraries/kos_mbedtls/library/libtcc/memmove.c new file mode 100644 index 0000000000..e4dc719288 --- /dev/null +++ b/programs/develop/libraries/kos_mbedtls/library/libtcc/memmove.c @@ -0,0 +1,33 @@ +/* memmove( void *, const void *, size_t ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include + +void * memmove( void * s1, const void * s2, size_t n ) +{ + char * dest = ( char * ) s1; + const char * src = ( const char * ) s2; + + if ( dest <= src ) + { + while ( n-- ) + { + *dest++ = *src++; + } + } + else + { + src += n; + dest += n; + + while ( n-- ) + { + *--dest = *--src; + } + } + + return s1; +} \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/library/libtcc/memset.c b/programs/develop/libraries/kos_mbedtls/library/libtcc/memset.c new file mode 100644 index 0000000000..225f349d87 --- /dev/null +++ b/programs/develop/libraries/kos_mbedtls/library/libtcc/memset.c @@ -0,0 +1,20 @@ +/* memset( void *, int, size_t ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include +#include + +void * memset( void * s, int c, size_t n ) +{ + unsigned char * p = ( unsigned char * ) s; + + while ( n-- ) + { + *p++ = ( unsigned char ) c; + } + + return s; +} \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/library/mbedtls_init.asm b/programs/develop/libraries/kos_mbedtls/library/mbedtls_init.asm new file mode 100644 index 0000000000..7167f0ef04 --- /dev/null +++ b/programs/develop/libraries/kos_mbedtls/library/mbedtls_init.asm @@ -0,0 +1,97 @@ +format coff +use32 ; Tell compiler to use 32 bit instructions + +;section '.export' + +section '.text' + +include '../../../../proc32.inc' +include '../../../../macros.inc' +include '../../../../debug-fdo.inc' +include '../../../../dll.inc' + + +public mbedtls_init +;;; Returns 0 on success. -1 on failure. + +__DEBUG__ = 1 +__DEBUG_LEVEL__ = 2 + + +mbedtls_init: + pushad + stdcall dll.Load, @IMPORT + ;int3 + test eax, eax + jnz .error + + popad + mov eax, 0 + ret + +.error: + popad + mov eax, -1 + ret + +gmtime: + jmp [localtime] + +;include_debug_strings + +section '.data' + +align 4 +@IMPORT: +library libc, 'libc.obj', networklib, 'network.obj' +import libc, \ + memcmp, 'memcmp', \ + printf, 'printf', \ + free, 'free', \ + strlen, 'strlen', \ + _strcmp, 'strcmp', \ + strstr, 'strstr', \ + rand, 'rand', \ + vsnprintf, 'vsnprintf', \ + socket, 'socket', \ + connect, 'connect', \ + close , 'close', \ + recv, 'recv', \ + send, 'send', \ + time, 'time', \ + strncmp, 'strncmp', \ + strncpy, 'strncpy', \ + calloc, 'calloc' , \ + snprintf, 'snprintf', \ + localtime, 'localtime' + +import networklib, \ + inet_addr, 'inet_addr', \ + inet_ntoa, 'inet_ntoa', \ + getaddrinfo, 'getaddrinfo', \ + freeaddrinfo, 'freeaddrinfo' + +public inet_addr +public inet_ntoa +public getaddrinfo +public freeaddrinfo + +public rand +public memcmp +public printf +public calloc +public free +public strlen +public _strcmp as 'strcmp' +public strstr +public gmtime +public vsnprintf +public socket +public connect +public close +public recv +public send +public time +public strncmp +public strncpy +public snprintf diff --git a/programs/develop/libraries/kos_mbedtls/library/net_sockets.c b/programs/develop/libraries/kos_mbedtls/library/net_sockets.c index dda15f4121..1a8962d044 100644 --- a/programs/develop/libraries/kos_mbedtls/library/net_sockets.c +++ b/programs/develop/libraries/kos_mbedtls/library/net_sockets.c @@ -44,9 +44,9 @@ #include -#include "kosnet/socket.h" -#include "kosnet/network.h" -/*#include +#include +#include +/* #include #include #include @@ -68,15 +68,17 @@ */ static int net_prepare( void ) { - load_network_obj(); + //load_network_obj(); return( 0 ); } + /* * Initialize a context */ void mbedtls_net_init( mbedtls_net_context *ctx ) { + //printf("snprintf=%p\n", printf); ctx->fd = -1; } @@ -119,7 +121,7 @@ int mbedtls_net_connect( mbedtls_net_context *ctx, const char *host, break; } - closesocket( ctx->fd ); + close( ctx->fd ); ret = MBEDTLS_ERR_NET_CONNECT_FAILED; } @@ -205,7 +207,7 @@ void mbedtls_net_free( mbedtls_net_context *ctx ) return; //shutdown( ctx->fd, 2 ); - closesocket( ctx->fd ); + close( ctx->fd ); ctx->fd = -1; } diff --git a/programs/develop/libraries/kos_mbedtls/library/platform_util.c b/programs/develop/libraries/kos_mbedtls/library/platform_util.c index 4c7b3a131b..14f5cfb32d 100644 --- a/programs/develop/libraries/kos_mbedtls/library/platform_util.c +++ b/programs/develop/libraries/kos_mbedtls/library/platform_util.c @@ -70,7 +70,7 @@ * mbedtls_platform_zeroize() to use a suitable implementation for their * platform and needs. */ -static void * (* const volatile memset_func)( void *, int, size_t ) = memset; +static void * (* const volatile memset_func)( void *, int, size_t ) = &memset; void mbedtls_platform_zeroize( void *buf, size_t len ) { @@ -86,7 +86,7 @@ void mbedtls_platform_zeroize( void *buf, size_t len ) #if !defined(_WIN32) && (defined(unix) || \ defined(__unix) || defined(__unix__) || (defined(__APPLE__) && \ defined(__MACH__))) -#include +//#include #endif /* !_WIN32 && (unix || __unix || __unix__ || * (__APPLE__ && __MACH__)) */ diff --git a/programs/develop/libraries/kos_mbedtls/programs/random/gen_entropy b/programs/develop/libraries/kos_mbedtls/programs/random/gen_entropy deleted file mode 100644 index a3149f226f..0000000000 Binary files a/programs/develop/libraries/kos_mbedtls/programs/random/gen_entropy and /dev/null differ diff --git a/programs/develop/libraries/kos_mbedtls/programs/random/gen_random_ctr_drbg b/programs/develop/libraries/kos_mbedtls/programs/random/gen_random_ctr_drbg deleted file mode 100644 index 251dfe7a14..0000000000 Binary files a/programs/develop/libraries/kos_mbedtls/programs/random/gen_random_ctr_drbg and /dev/null differ diff --git a/programs/develop/libraries/kos_mbedtls/programs/random/run_img.bat b/programs/develop/libraries/kos_mbedtls/programs/random/run_img.bat deleted file mode 100644 index acc38af55a..0000000000 --- a/programs/develop/libraries/kos_mbedtls/programs/random/run_img.bat +++ /dev/null @@ -1 +0,0 @@ -qemu-system-i386 -m 256 -fda ../../test_kos_images/kolibri.img -boot a -vga vmware -net nic,model=rtl8139 -net user -soundhw ac97 -usb -usbdevice tablet -drive file=fat:rw:. \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/programs/ssl/Makefile b/programs/develop/libraries/kos_mbedtls/programs/ssl/Makefile index ab3f88045c..bfd4b04d14 100644 --- a/programs/develop/libraries/kos_mbedtls/programs/ssl/Makefile +++ b/programs/develop/libraries/kos_mbedtls/programs/ssl/Makefile @@ -1,24 +1,12 @@ -NEWLIB_INCLUDES=D:\KOSSDK\newlib\libc\include -APP_DYNAMIC_LDS=D:\KOSSDK\newlib/app-dynamic.lds -LIBDIR=D:\KOSSDK\kos32-msys-5.4.0\win32\lib -MAIN_TARGET=ssl_client1 +FASM = fasm +TCC_DIR = /home/max/kolibri-svn/programs/develop/ktcc/trunk +TCC= $(TCC_DIR)/bin/kos32-tcc -CC=kos32-gcc -LD=kos32-ld -OBJCOPY=kos32-objcopy +CFLAGS= -I../../include -I$(TCC_DIR)/libc.obj/include -stack=10000 -CCFLAGS=-c -fomit-frame-pointer -I $(NEWLIB_INCLUDES) -I../../include -I../../kosnet/include -Wall -Wextra -LDFLAGS=-call_shared -nostdlib --subsystem console -T $(APP_DYNAMIC_LDS) --image-base 0 -L $(LIBDIR) -L ../../kosnet -L ../../library -lmbedtls -lmbedx509 -lmbedcrypto -lkosnet -lgcc -lapp -lc.dll - -all: ssl_client1 - -ssl_client1: ssl_client1.o - $(LD) ssl_client1.o -o $(MAIN_TARGET) $(LDFLAGS) - $(OBJCOPY) $(MAIN_TARGET) -O binary - -ssl_client1.o: ssl_client1.c - $(CC) $(CCFLAGS) ssl_client1.c -o ssl_client1.o +all: + $(FASM) load_mbedtls.asm + $(TCC) $(CFLAGS) ssl_client1.c load_mbedtls.o -o ssl_client1 -ltcc -lc.obj clean: - del *.o - del $(MAIN_TARGET) \ No newline at end of file + rm -f *.o ssl_client1 diff --git a/programs/develop/libraries/kos_mbedtls/programs/ssl/load_mbedtls.asm b/programs/develop/libraries/kos_mbedtls/programs/ssl/load_mbedtls.asm new file mode 100644 index 0000000000..fc667550e2 --- /dev/null +++ b/programs/develop/libraries/kos_mbedtls/programs/ssl/load_mbedtls.asm @@ -0,0 +1,153 @@ +format elf +use32 + +section '.text' executable + +include '../../../../../proc32.inc' +include '../../../../../macros.inc' +purge section,mov,add,sub + +include '../../../../../dll.inc' + +public mbedtls_load +public mbedtls_ctr_drbg_free +public mbedtls_ctr_drbg_init +public mbedtls_ctr_drbg_random +public mbedtls_ctr_drbg_seed +public mbedtls_debug_set_threshold +public mbedtls_entropy_free +public mbedtls_entropy_func +public mbedtls_entropy_init +public mbedtls_net_connect +public mbedtls_net_free +public mbedtls_net_init +public mbedtls_net_recv +public mbedtls_net_send +public mbedtls_ssl_close_notify +public mbedtls_ssl_conf_authmode +public mbedtls_ssl_conf_ca_chain +public mbedtls_ssl_conf_dbg +public mbedtls_ssl_config_defaults +public mbedtls_ssl_config_free +public mbedtls_ssl_config_init +public mbedtls_ssl_conf_rng +public mbedtls_ssl_free +public mbedtls_ssl_get_verify_result +public mbedtls_ssl_handshake +public mbedtls_ssl_init +public mbedtls_ssl_read +public mbedtls_ssl_set_bio +public mbedtls_ssl_set_hostname +public mbedtls_ssl_setup +public mbedtls_ssl_write +public mbedtls_strerror +public _mbedtls_test_cas_pem +public _mbedtls_test_cas_pem_len +public mbedtls_x509_crt_free +public mbedtls_x509_crt_init +public mbedtls_x509_crt_parse +public mbedtls_x509_crt_verify_info +public mbedtls_init +public __snprintf_test + +__snprintf_test: +ret + +;;; Returns 0 on success. -1 on failure. + +proc mbedtls_load + stdcall dll.Load, @IMPORT + test eax, eax + jnz error + + mov eax, 0 + ret + +error: + mov eax, -1 + ret +endp + +mbedtls_ctr_drbg_free: jmp [_mbedtls_ctr_drbg_free ] +mbedtls_ctr_drbg_init: jmp [_mbedtls_ctr_drbg_init ] +mbedtls_ctr_drbg_random: jmp [_mbedtls_ctr_drbg_random ] +mbedtls_ctr_drbg_seed: jmp [_mbedtls_ctr_drbg_seed ] +mbedtls_debug_set_threshold: jmp [_mbedtls_debug_set_threshold ] +mbedtls_entropy_free: jmp [_mbedtls_entropy_free ] +mbedtls_entropy_func: jmp [_mbedtls_entropy_func ] +mbedtls_entropy_init: jmp [_mbedtls_entropy_init ] +mbedtls_net_connect: jmp [_mbedtls_net_connect ] +mbedtls_net_free: jmp [_mbedtls_net_free ] +mbedtls_net_init: jmp [_mbedtls_net_init ] +mbedtls_net_recv: jmp [_mbedtls_net_recv ] +mbedtls_net_send: jmp [_mbedtls_net_send ] +mbedtls_ssl_close_notify: jmp [_mbedtls_ssl_close_notify ] +mbedtls_ssl_conf_authmode: jmp [_mbedtls_ssl_conf_authmode ] +mbedtls_ssl_conf_ca_chain: jmp [_mbedtls_ssl_conf_ca_chain ] +mbedtls_ssl_conf_dbg: jmp [_mbedtls_ssl_conf_dbg ] +mbedtls_ssl_config_defaults: jmp [_mbedtls_ssl_config_defaults ] +mbedtls_ssl_config_free: jmp [_mbedtls_ssl_config_free ] +mbedtls_ssl_config_init: jmp [_mbedtls_ssl_config_init ] +mbedtls_ssl_conf_rng: jmp [_mbedtls_ssl_conf_rng ] +mbedtls_ssl_free: jmp [_mbedtls_ssl_free ] +mbedtls_ssl_get_verify_result: jmp [_mbedtls_ssl_get_verify_result ] +mbedtls_ssl_handshake: jmp [_mbedtls_ssl_handshake ] +mbedtls_ssl_init: jmp [_mbedtls_ssl_init ] +mbedtls_ssl_read: jmp [_mbedtls_ssl_read ] +mbedtls_ssl_set_bio: jmp [_mbedtls_ssl_set_bio ] +mbedtls_ssl_set_hostname: jmp [_mbedtls_ssl_set_hostname ] +mbedtls_ssl_setup: jmp [_mbedtls_ssl_setup ] +mbedtls_ssl_write: jmp [_mbedtls_ssl_write ] +mbedtls_strerror: jmp [_mbedtls_strerror] +;mbedtls_test_cas_pem: jmp [_mbedtls_test_cas_pem ] +;mbedtls_test_cas_pem_len: jmp [_mbedtls_test_cas_pem_len ] +mbedtls_x509_crt_free: jmp [_mbedtls_x509_crt_free ] +mbedtls_x509_crt_init: jmp [_mbedtls_x509_crt_init ] +mbedtls_x509_crt_parse: jmp [_mbedtls_x509_crt_parse] +mbedtls_x509_crt_verify_info: jmp [_mbedtls_x509_crt_verify_info ] +mbedtls_init: jmp [_mbedtls_init] +;__snprintf_test: jmp[___snprintf_test] + +section '.data' writable +@IMPORT: +library mbedtls, 'mbedtls.obj' +import mbedtls, \ +_mbedtls_init , 'mbedtls_init' ,\ +_mbedtls_strerror , 'mbedtls_strerror' ,\ +_mbedtls_test_cas_pem , 'mbedtls_test_cas_pem' ,\ +_mbedtls_test_cas_pem_len , 'mbedtls_test_cas_pem_len' ,\ +_mbedtls_x509_crt_free , 'mbedtls_x509_crt_free' ,\ +_mbedtls_x509_crt_init , 'mbedtls_x509_crt_init' ,\ +_mbedtls_x509_crt_parse , 'mbedtls_x509_crt_parse' ,\ +_mbedtls_x509_crt_verify_info , 'mbedtls_x509_crt_verify_info' ,\ +_mbedtls_ctr_drbg_free , 'mbedtls_ctr_drbg_free' ,\ +_mbedtls_ctr_drbg_init , 'mbedtls_ctr_drbg_init' ,\ +_mbedtls_ctr_drbg_random , 'mbedtls_ctr_drbg_random' ,\ +_mbedtls_ctr_drbg_seed , 'mbedtls_ctr_drbg_seed' ,\ +_mbedtls_debug_set_threshold , 'mbedtls_debug_set_threshold' ,\ +_mbedtls_entropy_free , 'mbedtls_entropy_free' ,\ +_mbedtls_entropy_func , 'mbedtls_entropy_func' ,\ +_mbedtls_entropy_init , 'mbedtls_entropy_init' ,\ +_mbedtls_net_connect , 'mbedtls_net_connect' ,\ +_mbedtls_net_free , 'mbedtls_net_free' ,\ +_mbedtls_net_init , 'mbedtls_net_init' ,\ +_mbedtls_net_recv , 'mbedtls_net_recv' ,\ +_mbedtls_net_send , 'mbedtls_net_send' ,\ +_mbedtls_ssl_close_notify , 'mbedtls_ssl_close_notify' ,\ +_mbedtls_ssl_conf_authmode , 'mbedtls_ssl_conf_authmode' ,\ +_mbedtls_ssl_conf_ca_chain , 'mbedtls_ssl_conf_ca_chain' ,\ +_mbedtls_ssl_conf_dbg , 'mbedtls_ssl_conf_dbg' ,\ +_mbedtls_ssl_config_defaults , 'mbedtls_ssl_config_defaults' ,\ +_mbedtls_ssl_config_free , 'mbedtls_ssl_config_free' ,\ +_mbedtls_ssl_config_init , 'mbedtls_ssl_config_init' ,\ +_mbedtls_ssl_conf_rng , 'mbedtls_ssl_conf_rng' ,\ +_mbedtls_ssl_free , 'mbedtls_ssl_free' ,\ +_mbedtls_ssl_get_verify_result , 'mbedtls_ssl_get_verify_result' ,\ +_mbedtls_ssl_handshake , 'mbedtls_ssl_handshake' ,\ +_mbedtls_ssl_init , 'mbedtls_ssl_init' ,\ +_mbedtls_ssl_read , 'mbedtls_ssl_read' ,\ +_mbedtls_ssl_set_bio , 'mbedtls_ssl_set_bio' ,\ +_mbedtls_ssl_set_hostname , 'mbedtls_ssl_set_hostname' ,\ +_mbedtls_ssl_setup , 'mbedtls_ssl_setup' ,\ +_mbedtls_ssl_write , 'mbedtls_ssl_write' + diff --git a/programs/develop/libraries/kos_mbedtls/programs/ssl/run_img.bat b/programs/develop/libraries/kos_mbedtls/programs/ssl/run_img.bat deleted file mode 100644 index acc38af55a..0000000000 --- a/programs/develop/libraries/kos_mbedtls/programs/ssl/run_img.bat +++ /dev/null @@ -1 +0,0 @@ -qemu-system-i386 -m 256 -fda ../../test_kos_images/kolibri.img -boot a -vga vmware -net nic,model=rtl8139 -net user -soundhw ac97 -usb -usbdevice tablet -drive file=fat:rw:. \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/programs/ssl/ssl_client1 b/programs/develop/libraries/kos_mbedtls/programs/ssl/ssl_client1 deleted file mode 100644 index 85f547002d..0000000000 Binary files a/programs/develop/libraries/kos_mbedtls/programs/ssl/ssl_client1 and /dev/null differ diff --git a/programs/develop/libraries/kos_mbedtls/programs/ssl/ssl_client1.c b/programs/develop/libraries/kos_mbedtls/programs/ssl/ssl_client1.c index 8bf789ca30..64317873a8 100644 --- a/programs/develop/libraries/kos_mbedtls/programs/ssl/ssl_client1.c +++ b/programs/develop/libraries/kos_mbedtls/programs/ssl/ssl_client1.c @@ -20,16 +20,17 @@ * * This file is part of mbed TLS (https://tls.mbed.org) */ - #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#else +#include + +//#if defined(MBEDTLS_PLATFORM_C) +//#include "mbedtls/platform.h" +//#else #include #include #define mbedtls_time time @@ -37,16 +38,16 @@ #define mbedtls_fprintf fprintf #define mbedtls_printf printf #define mbedtls_exit exit -#define MBEDTLS_EXIT_SUCCESS EXIT_SUCCESS -#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE -#endif /* MBEDTLS_PLATFORM_C */ +#define MBEDTLS_EXIT_SUCCESS 0 +#define MBEDTLS_EXIT_FAILURE -1 +//#endif /* MBEDTLS_PLATFORM_C */ -#if !defined(MBEDTLS_BIGNUM_C) || !defined(MBEDTLS_ENTROPY_C) || \ +//#if !defined(MBEDTLS_BIGNUM_C) || !defined(MBEDTLS_ENTROPY_C) || \ !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_CLI_C) || \ !defined(MBEDTLS_NET_C) || !defined(MBEDTLS_RSA_C) || \ !defined(MBEDTLS_CERTS_C) || !defined(MBEDTLS_PEM_PARSE_C) || \ !defined(MBEDTLS_CTR_DRBG_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) -int main( void ) +/*int main( void ) { mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or " "MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or " @@ -55,7 +56,7 @@ int main( void ) "not defined.\n"); return( 0 ); } -#else +//#else*/ #include "mbedtls/net_sockets.h" #include "mbedtls/debug.h" @@ -70,12 +71,21 @@ int main( void ) //#define SERVER_PORT "443" //#define SERVER_NAME "wikipedia.org" //#define GET_REQUEST "GET / HTTP/1.0\r\n\r\n" -char SERVER_PORT[16]; -char SERVER_NAME[128]; -char GET_REQUEST[512]; +static char SERVER_PORT[16]; +static char SERVER_NAME[128]; +static char GET_REQUEST[512]; #define DEBUG_LEVEL 1 +extern int *_mbedtls_test_cas_pem_len; +extern char* _mbedtls_test_cas_pem; + +#define mbedtls_test_cas_pem_len *_mbedtls_test_cas_pem_len +#define mbedtls_test_cas_pem _mbedtls_test_cas_pem + +//gmtime(time_t t){puts("gmtime stub");}; + +//int load_network_obj(){return networklib_init();} static void my_debug( void *ctx, int level, const char *file, int line, @@ -90,11 +100,21 @@ static void my_debug( void *ctx, int level, int main( void ) { + if(mbedtls_load()){ + printf("mbedtls.obj not load!\n"); + return -1; + } + if(mbedtls_init()){ + puts("mbedtls.obj not init!"); + return -1; + } + puts("Enter SERVER_NAME : "); gets(SERVER_NAME); puts("Enter SERVER_PORT : "); gets(SERVER_PORT); sprintf(GET_REQUEST, "GET / HTTP/1.1\r\nHost: %s\r\n\r\n", SERVER_NAME); + //puts(GET_REQUEST); int ret = 1, len; int exit_code = MBEDTLS_EXIT_FAILURE; @@ -102,7 +122,6 @@ int main( void ) uint32_t flags; unsigned char buf[1024]; const char *pers = "ssl_client1"; - mbedtls_entropy_context entropy; mbedtls_ctr_drbg_context ctr_drbg; mbedtls_ssl_context ssl; @@ -110,7 +129,7 @@ int main( void ) mbedtls_x509_crt cacert; #if defined(MBEDTLS_DEBUG_C) - mbedtls_debug_set_threshold( DEBUG_LEVEL ); + // mbedtls_debug_set_threshold( DEBUG_LEVEL ); #endif /* @@ -121,10 +140,8 @@ int main( void ) mbedtls_ssl_config_init( &conf ); mbedtls_x509_crt_init( &cacert ); mbedtls_ctr_drbg_init( &ctr_drbg ); - mbedtls_printf( "\n . Seeding the random number generator..." ); //fflush( stdout ); - mbedtls_entropy_init( &entropy ); if( ( ret = mbedtls_ctr_drbg_seed( &ctr_drbg, mbedtls_entropy_func, &entropy, (const unsigned char *) pers, @@ -133,15 +150,15 @@ int main( void ) mbedtls_printf( " failed\n ! mbedtls_ctr_drbg_seed returned %d\n", ret ); goto exit; } - + mbedtls_printf( " ok\n" ); - + /* * 0. Initialize certificates - */ + */; mbedtls_printf( " . Loading the CA root certificate ..." ); //fflush( stdout ); - + ret = mbedtls_x509_crt_parse( &cacert, (const unsigned char *) mbedtls_test_cas_pem, mbedtls_test_cas_pem_len ); if( ret < 0 ) @@ -151,7 +168,7 @@ int main( void ) } mbedtls_printf( " ok (%d skipped)\n", ret ); - + /* * 1. Start the connection */ @@ -204,7 +221,6 @@ int main( void ) } mbedtls_ssl_set_bio( &ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL ); - /* * 4. Handshake */ @@ -301,15 +317,14 @@ int main( void ) exit_code = MBEDTLS_EXIT_SUCCESS; exit: - -#ifdef MBEDTLS_ERROR_C +//#ifdef MBEDTLS_ERROR_C if( exit_code != MBEDTLS_EXIT_SUCCESS ) { - char error_buf[100]; + static char error_buf[100]; mbedtls_strerror( ret, error_buf, 100 ); mbedtls_printf("Last error was: %d - %s\n\n", ret, error_buf ); } -#endif +//#endif mbedtls_net_free( &server_fd ); @@ -322,7 +337,7 @@ exit: return( exit_code ); } -#endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_SSL_TLS_C && +/*#endif MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_SSL_TLS_C && MBEDTLS_SSL_CLI_C && MBEDTLS_NET_C && MBEDTLS_RSA_C && MBEDTLS_CERTS_C && MBEDTLS_PEM_PARSE_C && MBEDTLS_CTR_DRBG_C && MBEDTLS_X509_CRT_PARSE_C */ diff --git a/programs/develop/libraries/kos_mbedtls/test_kos_images/about_image.md b/programs/develop/libraries/kos_mbedtls/test_kos_images/about_image.md deleted file mode 100644 index fcf619f2e0..0000000000 --- a/programs/develop/libraries/kos_mbedtls/test_kos_images/about_image.md +++ /dev/null @@ -1,6 +0,0 @@ -Test KOS image features: - - rev 8498 - - kernel unpacked (to run faster in qemu for windows) - - kolibrios/ directory with lib/libc.dll (newlib) inside automatically mounts on start - - DOCKY removed from autorun.dat (cuz its very annoying :D ) - - removed 3d, demos, games, fnav, kfm, animage, iconedit, etc. to get free space for things above \ No newline at end of file diff --git a/programs/develop/libraries/kos_mbedtls/test_kos_images/kolibri.img b/programs/develop/libraries/kos_mbedtls/test_kos_images/kolibri.img deleted file mode 100644 index 8dc57a8b64..0000000000 Binary files a/programs/develop/libraries/kos_mbedtls/test_kos_images/kolibri.img and /dev/null differ