From 26564b6081caff9b817dd1fa1afa164eb066faad Mon Sep 17 00:00:00 2001 From: sergeych Date: Mon, 19 Aug 2024 18:34:11 +0200 Subject: [PATCH] 0.4.1: performance, incompatible keys ID (as of crypto2 upgrade), fixed tests to properly run on Macos on arm64 target --- README.md | 10 +++++++--- build.gradle.kts | 4 ++-- .../kotlin/net/sergeych/kiloparsec/Transport.kt | 1 - .../net/sergeych/kiloparsec/adapter/InternetTest.kt | 8 ++++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7f0a73c..6f271a0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Kiloparsec -__Recommended version is `0.3.3`: to keep the code compatible with current and further versions we -ask to upgrade to `0.3.2` at least.__ Starting from this version some pacakage names are changed for +__Recommended version is `0.4.1`: to keep the code compatible with current and further versions we +ask to upgrade to `0.4.2` at least.__ Starting from this version some pacakage names are changed for better clarity and fast UDP endpoints are added. The new generation of __PARanoid SECurity__ protocol, advanced, faster, more secure. It also allows connecting any " @@ -22,6 +22,10 @@ provides the following transports: Protocols >= 0.3.0 are not binary compatible with previous version due to more compact binary format. The format from 0.3.0 onwards is supposed to keep compatible. +#### ID calculation algorithm is changed since 0.4.1 + +We recommend to upgrade to 0.4+ ASAP as public/shared key id derivation method was changed for even higher security. + ### Supported native targets - iosArm64, iosX64 @@ -76,7 +80,7 @@ It could be, depending on your project structure, something like: ```kotlin val commonMain by getting { dependencies { - api("net.sergeych:kiloparsec:0.3.2") + api("net.sergeych:kiloparsec:0.4.1") } } ``` diff --git a/build.gradle.kts b/build.gradle.kts index 725cfb1..6442f58 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } group = "net.sergeych" -version = "0.3.3" +version = "0.4.1" repositories { mavenCentral() @@ -44,7 +44,7 @@ kotlin { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1") api("io.ktor:ktor-client-core:$ktor_version") - api("net.sergeych:crypto2:0.4.2") + api("net.sergeych:crypto2:0.5.3") } } val ktorSocketMain by creating { diff --git a/src/commonMain/kotlin/net/sergeych/kiloparsec/Transport.kt b/src/commonMain/kotlin/net/sergeych/kiloparsec/Transport.kt index 6a4384e..d01baba 100644 --- a/src/commonMain/kotlin/net/sergeych/kiloparsec/Transport.kt +++ b/src/commonMain/kotlin/net/sergeych/kiloparsec/Transport.kt @@ -231,7 +231,6 @@ class Transport( .also { debug { "command executed: ${b.name}" } } } } - debug { "=---------------------------------------------" } } debug { "input step performed closed=$isClosed active=$isActive" } } catch (_: ClosedSendChannelException) { diff --git a/src/ktorSocketTest/kotlin/net/sergeych/kiloparsec/adapter/InternetTest.kt b/src/ktorSocketTest/kotlin/net/sergeych/kiloparsec/adapter/InternetTest.kt index 0fc930f..82ba3a5 100644 --- a/src/ktorSocketTest/kotlin/net/sergeych/kiloparsec/adapter/InternetTest.kt +++ b/src/ktorSocketTest/kotlin/net/sergeych/kiloparsec/adapter/InternetTest.kt @@ -104,7 +104,7 @@ class InternetrTest { val client = KiloClient() { addErrors(cli) - connect { connectUdpDevice("localhost:$port") } + connect { connectUdpDevice("127.0.0.1:$port") } } assertEquals("start", client.call(cmdLoad)) @@ -132,7 +132,7 @@ class InternetrTest { var data: String, ) - val port = 27170 + Random.nextInt(1, 200) + val port = 27170 + Random.nextInt(1, 900) val cmdSave by command() val cmdLoad by command() @@ -165,9 +165,9 @@ class InternetrTest { val client = KiloClient() { addErrors(cli) - connect { connectUdpDevice("localhost:$port") } + connect { connectUdpDevice("127.0.0.1:$port") } } - val client2 = KiloClient() { connect { connectUdpDevice("localhost:${port+1}") } } + val client2 = KiloClient() { connect { connectUdpDevice("127.0.0.1:${port+1}") } } assertEquals("start", client.call(cmdLoad)) assertEquals("start", client2.call(cmdLoad))