aboutsummaryrefslogtreecommitdiff
path: root/src/internal/nc-util.h
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-04-23 14:48:05 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-04-23 14:48:05 -0400
commit30e8dda6cbea86bdee6d5dfe48514385d3b9f81b (patch)
tree49a4e59a5e0bdf867e31168852d7299c6bb7c783 /src/internal/nc-util.h
parentd09c6c1bd5da3e2d79351daeba304ca99976a726 (diff)
refactor: Crypto dep redesign working on Windows
Diffstat (limited to 'src/internal/nc-util.h')
-rw-r--r--src/internal/nc-util.h28
1 files changed, 27 insertions, 1 deletions
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 <stdint.h>
+
+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