From fdf662f8f1a1a3b38fe4d251982fffab8e9bf664 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 17 May 2026 05:27:06 +0530 Subject: Phase 7: MCP handler (25 tests), NIP-04 encrypt/decrypt (15 tests), CVM server skeleton - mcp_handler.c/h: 4 tools (get_config, set_config, get_balance, wallet_send) - nip04.c/h: AES-256-CBC + ECDH with 0x02 compressed pubkey prefix - Fixed IV copy bug: mbedTLS AES-CBC modifies IV in-place - Base64 encode/decode for ciphertext transport - PKCS7 padding - cvm_server.c/h: Nostr DM listener with FreeRTOS task - config: cvm_enabled, cvm_relays fields - 156 total tests passing across 10 test binaries --- main/nip04.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 main/nip04.h (limited to 'main/nip04.h') diff --git a/main/nip04.h b/main/nip04.h new file mode 100644 index 0000000..f612a8e --- /dev/null +++ b/main/nip04.h @@ -0,0 +1,13 @@ +#ifndef NIP04_H +#define NIP04_H + +#include +#include + +void nip04_encrypt(const uint8_t *sender_privkey, const uint8_t *recipient_pubkey, + const char *plaintext, uint8_t *ciphertext_base64, size_t *out_len); + +int nip04_decrypt(const uint8_t *recipient_privkey, const uint8_t *sender_pubkey, + const char *ciphertext_base64, char *plaintext, size_t plaintext_max); + +#endif -- cgit v1.2.3