diff --git a/VERSION b/VERSION index f9056827..cb498ab2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.7 +0.4.8 diff --git a/nostr_core/nostr_core.h b/nostr_core/nostr_core.h index 0a79808e..4fe9bbef 100644 --- a/nostr_core/nostr_core.h +++ b/nostr_core/nostr_core.h @@ -2,10 +2,10 @@ #define NOSTR_CORE_H // Version information (auto-updated by increment_and_push.sh) -#define VERSION "v0.4.7" +#define VERSION "v0.4.8" #define VERSION_MAJOR 0 #define VERSION_MINOR 4 -#define VERSION_PATCH 7 +#define VERSION_PATCH 8 /* * NOSTR Core Library - Complete API Reference diff --git a/tests/nip17_test b/tests/nip17_test index 36f099ce..3a9e80a8 100755 Binary files a/tests/nip17_test and b/tests/nip17_test differ diff --git a/tests/nip44_test b/tests/nip44_test index a9404fdf..ac60a327 100755 Binary files a/tests/nip44_test and b/tests/nip44_test differ diff --git a/tests/nip44_test.c b/tests/nip44_test.c index 6d3b51e2..1f4aafb9 100644 --- a/tests/nip44_test.c +++ b/tests/nip44_test.c @@ -46,7 +46,7 @@ static nip44_test_vector_t test_vectors[] = { NULL }, { - "1MB payload test", + "64KB payload test", "91ba716fa9e7ea2fcbad360cf4f8e0d312f73984da63d90f524ad61a6a1e7dbe", // Same keys as basic test "96f6fa197aa07477ab88f6981118466ae3a982faab8ad5db9d5426870c73d220", NULL, // Will be generated dynamically @@ -99,12 +99,12 @@ static int test_nip44_round_trip(const nip44_test_vector_t* tv) { // Special handling for large payload tests char* test_plaintext; - if (strcmp(tv->name, "1MB payload test") == 0) { - // Generate exactly 1MB (1,048,576 bytes) of predictable content - const size_t payload_size = 1048576; + if (strcmp(tv->name, "64KB payload test") == 0) { + // Generate exactly 64KB (65,535 bytes) of predictable content - max NIP-44 size + const size_t payload_size = 65535; test_plaintext = malloc(payload_size + 1); if (!test_plaintext) { - printf(" FAIL: Memory allocation failed for 1MB test payload\n"); + printf(" FAIL: Memory allocation failed for 64KB test payload\n"); return -1; } @@ -118,7 +118,7 @@ static int test_nip44_round_trip(const nip44_test_vector_t* tv) { } test_plaintext[payload_size] = '\0'; - printf(" Generated 1MB test payload (%zu bytes)\n", payload_size); + printf(" Generated 64KB test payload (%zu bytes)\n", payload_size); printf(" Pattern: \"%s\" repeated\n", pattern); printf(" First 64 chars: \"%.64s...\"\n", test_plaintext); printf(" Last 64 chars: \"...%.64s\"\n", test_plaintext + payload_size - 64); @@ -158,10 +158,10 @@ static int test_nip44_round_trip(const nip44_test_vector_t* tv) { } // Test decryption - use recipient private key + sender public key - char* decrypted = malloc(1048576 + 1); // 1MB + 1 for null terminator + char* decrypted = malloc(65536 + 1); // 64KB + 1 for null terminator if (!decrypted) { printf(" FAIL: Memory allocation failed for decrypted buffer\n"); - if (strcmp(tv->name, "1MB payload test") == 0) free(test_plaintext); + if (strcmp(tv->name, "64KB payload test") == 0) free(test_plaintext); free(encrypted); return -1; } @@ -170,7 +170,7 @@ static int test_nip44_round_trip(const nip44_test_vector_t* tv) { sender_public_key, encrypted, decrypted, - 1048576 + 1 + 65536 + 1 ); if (decrypt_result != NOSTR_SUCCESS) { @@ -192,17 +192,17 @@ static int test_nip44_round_trip(const nip44_test_vector_t* tv) { return -1; } - if (strcmp(tv->name, "1MB payload test") == 0) { - printf(" ✅ 1MB payload round-trip: PASS\n"); + if (strcmp(tv->name, "64KB payload test") == 0) { + printf(" ✅ 64KB payload round-trip: PASS\n"); printf(" ✅ Content verification: All %zu bytes match perfectly!\n", strlen(test_plaintext)); printf(" Encrypted length: %zu bytes\n", strlen(encrypted)); - printf(" 🎉 1MB NIP-44 STRESS TEST COMPLETED SUCCESSFULLY! 🎉\n"); + printf(" 🎉 64KB NIP-44 STRESS TEST COMPLETED SUCCESSFULLY! 🎉\n"); } else { printf(" PASS: Expected: \"%s\", Actual: \"%s\"\n", test_plaintext, decrypted); printf(" Encrypted output: %s\n", encrypted); } - if (strcmp(tv->name, "1MB payload test") == 0) free(test_plaintext); + if (strcmp(tv->name, "64KB payload test") == 0) free(test_plaintext); free(encrypted); free(decrypted);