diff --git a/README.md b/README.md index 4188c2b..881411f 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,6 @@ ![Danger: Experimental](https://camo.githubusercontent.com/275bc882f21b154b5537b9c123a171a30de9e6aa/68747470733a2f2f7261772e6769746875622e636f6d2f63727970746f7370686572652f63727970746f7370686572652f6d61737465722f696d616765732f6578706572696d656e74616c2e706e67) -# Kotlin Multiplatform Crypto Library - -This repository contains two cryptography related projects: - -1. Libsodium bindings for Kotiln Multiplatform -2. Pure/Delegated kotlin multiplatform crypto library written from scratch in pure kotlin/delegated to libsodium. [Link to project readme](https://github.com/ionspin/kotlin-multiplatform-crypto/blob/master/multiplatform-crypto-api/README.md) - -This readme represents the libsodium bindings project - # Libsodium bindings for Kotiln Multiplatform Libsodium bindings project uses libsodium c sources, libsodium.js as well as LazySodium Java and Android to provide a kotlin multiplatform wrapper library for libsodium. @@ -116,22 +107,22 @@ At the moment you should refer to original libsodium documentation for instructi Currently supported native platforms: -|Platform|Pure variant| Delegated variant| -|--------|------------|------------------| -|Linux X86 64| :heavy_check_mark: | :heavy_check_mark: | -|Linux Arm 64| :heavy_check_mark: | :heavy_check_mark: | -|Linux Arm 32| :heavy_check_mark: | :x: | -|macOS X86 64| :heavy_check_mark: | :heavy_check_mark: | -|iOS x86 64 | :heavy_check_mark: | :heavy_check_mark: | -|iOS Arm 64 | :heavy_check_mark: | :heavy_check_mark: | -|iOS Arm 32 | :heavy_check_mark: | :heavy_check_mark: | -|watchOS X86 32 | :heavy_check_mark: | :heavy_check_mark: | -|watchOS Arm 64(_32) | :heavy_check_mark: | :heavy_check_mark: | -|watchos Arm 32 | :heavy_check_mark: | :heavy_check_mark: | -|tvOS X86 64 | :heavy_check_mark: | :heavy_check_mark: | -|tvOS Arm 64 | :heavy_check_mark: | :heavy_check_mark: | -|minGW X86 64| :heavy_check_mark: | :heavy_check_mark: | -|minGW X86 32| :x: | :x: | +|Platform| Supported | +|--------|------------------| +|Linux X86 64| :heavy_check_mark: | +|Linux Arm 64| :heavy_check_mark: | +|Linux Arm 32| :x: | +|macOS X86 64| :heavy_check_mark: | +|iOS x86 64 | :heavy_check_mark: | +|iOS Arm 64 | :heavy_check_mark: | +|iOS Arm 32 | :heavy_check_mark: | +|watchOS X86 32 | :heavy_check_mark: | +|watchOS Arm 64(_32) | :heavy_check_mark: | +|watchos Arm 32 | :heavy_check_mark: | +|tvOS X86 64 | :heavy_check_mark: | +|tvOS Arm 64 | :heavy_check_mark: | +|minGW X86 64| :heavy_check_mark: | +|minGW X86 32| :x: | ### TODO: @@ -142,7 +133,20 @@ Currently supported native platforms: - LobsodiumUtil `unpad` and `fromBase64` native implementations use a nasty hack to support shared native sourceset. The hack either needs to be removed and replaced with another solution or additional safeguards need to be added. - Complete exposing libsodium constants +### Known issues: +- Using LazySodium self built variant to fix some of the bugs present in LazySodium, but **Android** is using directly + LazySodium release which has not been updated (latest version is 4.2.0), this means that randombytes_random, basetobin and + base64tohex functions are not working on Android, as well as problems with sodium_pad: + + https://github.com/terl/lazysodium-java/issues/83 + + https://github.com/terl/lazysodium-java/issues/85 + https://github.com/terl/lazysodium-java/issues/86 + + Also it is not clear where are the precompiled libraries in LazySodium coming from + + This will be handled by providing a new JNA libsodium wrapper library diff --git a/buildSrc/src/main/kotlin/Deps.kt b/buildSrc/src/main/kotlin/Deps.kt index edf6f4a..8823416 100644 --- a/buildSrc/src/main/kotlin/Deps.kt +++ b/buildSrc/src/main/kotlin/Deps.kt @@ -15,13 +15,13 @@ */ object Versions { - val kotlinCoroutines = "1.4.1" - val kotlin = "1.4.20" + val kotlinCoroutines = "1.4.2" + val kotlin = "1.4.21" val kotlinSerialization = "1.0.1" val kotlinSerializationPlugin = "1.4.10" val atomicfu = "0.14.3-M2-2-SNAPSHOT" //NOTE: my linux arm32 and arm64 build val nodePlugin = "1.3.0" - val dokkaPlugin = "1.4.0" + val dokkaPlugin = "1.4.20" val taskTreePlugin = "1.5" val kotlinBigNumVersion = "0.2.2" val lazySodium = "4.3.1-SNAPSHOT" diff --git a/multiplatform-crypto-api/build.gradle.kts b/multiplatform-crypto-api/build.gradle.kts index 4c655f0..30299cc 100644 --- a/multiplatform-crypto-api/build.gradle.kts +++ b/multiplatform-crypto-api/build.gradle.kts @@ -267,23 +267,7 @@ kotlin { } tasks { - create("javadocJar") { - dependsOn(dokkaJavadoc) - archiveClassifier.set("javadoc") - from(dokkaJavadoc.get().outputDirectory) - } - dokkaJavadoc { - println("Dokka !") - dokkaSourceSets { - named("commonMain") { - displayName.set("common") - platform.set(Platform.common) - } - } - - - } if (getHostOsName() == "linux" && getHostArchitecture() == "x86-64") { val jvmTest by getting(Test::class) { diff --git a/multiplatform-crypto-libsodium-bindings/build.gradle.kts b/multiplatform-crypto-libsodium-bindings/build.gradle.kts index 7aee1fb..4cb2428 100644 --- a/multiplatform-crypto-libsodium-bindings/build.gradle.kts +++ b/multiplatform-crypto-libsodium-bindings/build.gradle.kts @@ -28,10 +28,10 @@ plugins { id(PluginsDeps.mavenPublish) id(PluginsDeps.signing) id(PluginsDeps.node) version Versions.nodePlugin - id(PluginsDeps.dokka) id(PluginsDeps.taskTree) version Versions.taskTreePlugin id(PluginsDeps.androidLibrary) id(PluginsDeps.kotlinAndroidExtensions) + id(PluginsDeps.dokka) } @@ -586,35 +586,18 @@ tasks.whenTaskAdded { tasks { - create("javadocJar") { - dependsOn(dokkaJavadoc) - archiveClassifier.set("javadoc") - from(dokkaJavadoc.get().outputDirectory) - } - - dokkaJavadoc { - println("Dokka !") - dokkaSourceSets { - named("commonMain") { - displayName.set("common") - platform.set(Platform.common) - } - } - - - } - dokkaHtml { println("Dokka Html!") dokkaSourceSets { named("commonMain") { // displayName.set("common") // platform.set(Platform.common) - moduleDisplayName.set("Kotlin Multiplatform Libsodium Bindings") + moduleName.set("Kotlin Multiplatform Libsodium Bindings") includes.from( "src/commonMain/kotlin/com.ionspin.kotlin.crypto/aead/Aead.md", "src/commonMain/kotlin/com.ionspin.kotlin.crypto/auth/Auth.md", "src/commonMain/kotlin/com.ionspin.kotlin.crypto/box/Box.md", + "src/commonMain/kotlin/com.ionspin.kotlin.crypto/generichash/GenericHash.md", "src/commonMain/kotlin/com.ionspin.kotlin.crypto/CryptoModule.md") displayName.set("Kotlin multiplatform") } @@ -693,7 +676,6 @@ signing { publishing { publications.withType(MavenPublication::class) { - artifact(tasks["javadocJar"]) pom { name.set("Kotlin Multiplatform Crypto") description.set("Kotlin Multiplatform Crypto library") diff --git a/settings.gradle.kts b/settings.gradle.kts index 884beca..d0a5cf9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -34,7 +34,7 @@ pluginManagement { } } enableFeaturePreview("GRADLE_METADATA") -rootProject.name = "KotlinMultiplatformCrypto" +rootProject.name = "KotlinMultiplatformLibsodium" include("multiplatform-crypto-api") include("multiplatform-crypto-libsodium-bindings") include("sample") diff --git a/windowsBuild-delegated.sh b/windowsBuild-delegated.sh index 3a2bcbe..cd71323 100755 --- a/windowsBuild-delegated.sh +++ b/windowsBuild-delegated.sh @@ -14,5 +14,6 @@ echo "completed libsodium build" cd .. #and then libsodium bindings ./gradlew --no-daemon multiplatform-crypto-libsodium-bindings:build || exit 1 +echo "Script completed" exit 0 diff --git a/windowsBuildAndPublish-delegated.sh b/windowsBuildAndPublish-delegated.sh index 9281e98..b3efb6a 100755 --- a/windowsBuildAndPublish-delegated.sh +++ b/windowsBuildAndPublish-delegated.sh @@ -14,5 +14,6 @@ echo "completed libsodium build" cd .. ./gradlew --no-daemon multiplatform-crypto-libsodium-bindings:build || exit 1 ./gradlew --no-daemon multiplatform-crypto-libsodium-bindings:publishMingwX64PublicationToSnapshotRepository || exit 1 +echo "Script completed" exit 0