mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-26 07:45:21 +00:00
fix nip-17 (#305)
* NIP-59 stuff * nip-17 ios to androing works, android to ios still wip * fix impl * ios compat * default relays for DMs * delivery ack works * delivery ack --------- Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
@@ -122,9 +122,13 @@ class NostrTestManager(private val context: Context) {
|
||||
val (recipientPrivate, recipientPublic) = NostrCrypto.generateKeyPair()
|
||||
val plaintext = "Hello, Nostr world! This is a test message."
|
||||
|
||||
val encrypted = NostrCrypto.encryptNIP44(plaintext, recipientPublic, privateKey)
|
||||
val encrypted = NostrCrypto.encryptNIP44(
|
||||
plaintext,
|
||||
recipientPublic,
|
||||
privateKey
|
||||
)
|
||||
require(encrypted.isNotEmpty()) { "Encryption failed" }
|
||||
|
||||
|
||||
val decrypted = NostrCrypto.decryptNIP44(encrypted, publicKey, recipientPrivate)
|
||||
require(decrypted == plaintext) { "Decryption failed: expected '$plaintext', got '$decrypted'" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user