aboutsummaryrefslogtreecommitdiff
path: root/src/nc-util.h
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-07-12 22:14:00 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-07-12 22:14:00 -0400
commit5dfafbc5a9214587533ec8b1dae2a962118d3650 (patch)
tree03bee9bd074962a65924b63e66612b95fb9e2546 /src/nc-util.h
parent8df8c5aed4ac626171b451b5422c3b207e88000b (diff)
feat: add decryption functionality to public api
Diffstat (limited to 'src/nc-util.h')
-rw-r--r--src/nc-util.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nc-util.h b/src/nc-util.h
index e94a222..d0afe28 100644
--- a/src/nc-util.h
+++ b/src/nc-util.h
@@ -151,4 +151,18 @@ static _nc_fn_inline span_t ncSpanSlice(span_t span, uint32_t offset, uint32_t s
return slice;
}
+static _nc_fn_inline cspan_t ncSpanSliceC(cspan_t span, uint32_t offset, uint32_t size)
+{
+ cspan_t slice;
+
+ DEBUG_ASSERT2(span.data != NULL, "Expected span to be non-null");
+ DEBUG_ASSERT2(offset + size <= span.size, "Expected offset + size to be less than span size")
+
+ /* Initialize slice, offset input data by the specified offset */
+ ncSpanInitC(&slice, span.data + offset, size);
+
+ return slice;
+}
+
+
#endif /* !_NC_UTIL_H */ \ No newline at end of file