From 30e8dda6cbea86bdee6d5dfe48514385d3b9f81b Mon Sep 17 00:00:00 2001 From: vnugent Date: Tue, 23 Apr 2024 14:48:05 -0400 Subject: refactor: Crypto dep redesign working on Windows --- src/internal/nc-util.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/internal/nc-util.h') diff --git a/src/internal/nc-util.h b/src/internal/nc-util.h index 9026d29..9f72470 100644 --- a/src/internal/nc-util.h +++ b/src/internal/nc-util.h @@ -3,7 +3,7 @@ * Copyright (c) 2024 Vaughn Nugent * * Package: noscrypt -* File: nc-util.c +* File: nc-util.h * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -59,4 +59,30 @@ #define STATIC_ASSERT(x, m) #endif +#include + +typedef struct memory_span_struct +{ + uint8_t* data; + uint64_t size; +} span_t; + +typedef struct read_only_memory_span_struct +{ + const uint8_t* data; + uint64_t size; +} cspan_t; + +static void ncSpanInitC(cspan_t* span, const uint8_t* data, uint64_t size) +{ + span->data = data; + span->size = size; +} + +static void ncSpanInit(span_t* span, uint8_t* data, uint64_t size) +{ + span->data = data; + span->size = size; +} + #endif /* NC_UTIL_H */ \ No newline at end of file -- cgit