diff options
Diffstat (limited to 'code/test/init.c')
-rw-r--r-- | code/test/init.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/code/test/init.c b/code/test/init.c deleted file mode 100644 index 7e39f87..0000000 --- a/code/test/init.c +++ /dev/null @@ -1,36 +0,0 @@ -#include <stdlib.h> -#include <fcntl.h> -#include <unistd.h> - -#include "core.h" - -static int v_rng(void *buf, size_t bufsize) { - int fd; - - if((fd = open("/dev/urandom", O_RDONLY)) < 0) return -1; - size_t nb = read(fd, buf, bufsize); - close(fd); - if (nb != bufsize) return -1; - return 0; -} - -static ECPConnection *conn_alloc(unsigned char type) { - return malloc(sizeof(ECPConnection)); -} - -static void conn_free(ECPConnection *conn) { - free(conn); -} - -int ecp_init(ECPContext *ctx) { - int rv; - - rv = ecp_ctx_create(ctx); - if (rv) return rv; - - ctx->rng = v_rng; - ctx->conn_alloc = conn_alloc; - ctx->conn_free = conn_free; - - return ECP_OK; -}
\ No newline at end of file |