aboutsummaryrefslogtreecommitdiff
path: root/include/noscrypt.h
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-08-12 13:56:03 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-08-12 13:56:03 -0400
commita6392806eae7f302031afbcf22664ba33cbc4ad1 (patch)
treee2ffc7daee461ae0946763e3227dfd801f087359 /include/noscrypt.h
parenta97012676cc836ec50ef5ff6d8e97134aa7a1d22 (diff)
simple cleanup & some api notes
Diffstat (limited to 'include/noscrypt.h')
-rw-r--r--include/noscrypt.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/noscrypt.h b/include/noscrypt.h
index 574cef9..3702555 100644
--- a/include/noscrypt.h
+++ b/include/noscrypt.h
@@ -125,6 +125,27 @@ extern "C" {
#define NC_ENC_SET_NIP44_MAC_KEY 0x03
#define NC_ENC_SET_NIP04_KEY 0x04
+/*
+* API NOTES:
+*
+* - Decisions on integer width
+* Since noscrypt will target general purpose processors and embedded
+* systems (future) I didn't want to risk word size issues causing under/overflow
+* for the time being, so a fixed integer width was used and internal code
+* supports and guards against the platform default integer width (size_t)
+*
+* I'd like to support 64bit stuff, but really the underlying systems don't
+* need to support that size buffer, nor do I expect platforms to have more than
+* 4GB sized buffers (int32_t), it's just not practial and most work is on
+* digests anyway.
+*
+* - Decisions on unsigned vs signed
+* Yeah, I know this is a popular squabble in C land, but implementation details
+* should not trouble the user. If I expect an unsigned int, then it should be
+* explicit, negative number guards are cumbersom to handle return codes with
+* that IMO most engineers don't bother doing anyway or doing well at the very
+* least, so I'm using unsgined integers. Sorry, not sorry.
+*/
/* A compressed resul/return value, negative values
are failure, 0 is success and positive values are