diff options
Diffstat (limited to 'src/noscrypt.c')
-rw-r--r-- | src/noscrypt.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/noscrypt.c b/src/noscrypt.c index fac3dfb..d1c7dca 100644 --- a/src/noscrypt.c +++ b/src/noscrypt.c @@ -52,11 +52,24 @@ #endif /* !NC_DISABLE_INPUT_VALIDATION */ /* +* Actual, private defintion of the NCContext structure +* to allow for future development and ABI backords +* compatability. +*/ +struct nc_ctx_struct { + + void* secpCtx; + +}; + +/* * The Nip44 constant salt * https://github.com/nostr-protocol/nips/blob/master/44.md#encryption */ static const uint8_t Nip44ConstantSalt[8] = { 0x6e, 0x69, 0x70, 0x34, 0x34, 0x2d, 0x76, 0x32 }; +static struct nc_ctx_struct _ncSharedCtx; + struct shared_secret { uint8_t value[NC_SHARED_SEC_SIZE]; }; @@ -429,6 +442,12 @@ NC_EXPORT uint32_t NC_CC NCGetContextStructSize(void) return sizeof(NCContext); } +NC_EXPORT NCContext* NC_CC NCGetSharedContext(void) +{ + /*Return the global address of the shared context structure */ + return &_ncSharedCtx; +} + NC_EXPORT NCResult NC_CC NCInitContext( NCContext* ctx, const uint8_t entropy[NC_CONTEXT_ENTROPY_SIZE] |