Merge pull request #5 from ionspin/update-readme-and-release

Update readme and prepare 0.1.1 release
This commit is contained in:
Ugljesa Jovanovic 2021-01-11 14:54:00 +00:00 committed by GitHub
commit f10bf999a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 38 additions and 66 deletions

View File

@ -3,15 +3,6 @@
![Danger: Experimental](https://camo.githubusercontent.com/275bc882f21b154b5537b9c123a171a30de9e6aa/68747470733a2f2f7261772e6769746875622e636f6d2f63727970746f7370686572652f63727970746f7370686572652f6d61737465722f696d616765732f6578706572696d656e74616c2e706e67) ![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 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. 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: Currently supported native platforms:
|Platform|Pure variant| Delegated variant| |Platform| Supported |
|--------|------------|------------------| |--------|------------------|
|Linux X86 64| :heavy_check_mark: | :heavy_check_mark: | |Linux X86 64| :heavy_check_mark: |
|Linux Arm 64| :heavy_check_mark: | :heavy_check_mark: | |Linux Arm 64| :heavy_check_mark: |
|Linux Arm 32| :heavy_check_mark: | :x: | |Linux Arm 32| :x: |
|macOS X86 64| :heavy_check_mark: | :heavy_check_mark: | |macOS X86 64| :heavy_check_mark: |
|iOS x86 64 | :heavy_check_mark: | :heavy_check_mark: | |iOS x86 64 | :heavy_check_mark: |
|iOS Arm 64 | :heavy_check_mark: | :heavy_check_mark: | |iOS Arm 64 | :heavy_check_mark: |
|iOS Arm 32 | :heavy_check_mark: | :heavy_check_mark: | |iOS Arm 32 | :heavy_check_mark: |
|watchOS X86 32 | :heavy_check_mark: | :heavy_check_mark: | |watchOS X86 32 | :heavy_check_mark: |
|watchOS Arm 64(_32) | :heavy_check_mark: | :heavy_check_mark: | |watchOS Arm 64(_32) | :heavy_check_mark: |
|watchos Arm 32 | :heavy_check_mark: | :heavy_check_mark: | |watchos Arm 32 | :heavy_check_mark: |
|tvOS X86 64 | :heavy_check_mark: | :heavy_check_mark: | |tvOS X86 64 | :heavy_check_mark: |
|tvOS Arm 64 | :heavy_check_mark: | :heavy_check_mark: | |tvOS Arm 64 | :heavy_check_mark: |
|minGW X86 64| :heavy_check_mark: | :heavy_check_mark: | |minGW X86 64| :heavy_check_mark: |
|minGW X86 32| :x: | :x: | |minGW X86 32| :x: |
### TODO: ### 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. - 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 - 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

View File

@ -15,13 +15,13 @@
*/ */
object Versions { object Versions {
val kotlinCoroutines = "1.4.1" val kotlinCoroutines = "1.4.2"
val kotlin = "1.4.20" val kotlin = "1.4.21"
val kotlinSerialization = "1.0.1" val kotlinSerialization = "1.0.1"
val kotlinSerializationPlugin = "1.4.10" val kotlinSerializationPlugin = "1.4.10"
val atomicfu = "0.14.3-M2-2-SNAPSHOT" //NOTE: my linux arm32 and arm64 build val atomicfu = "0.14.3-M2-2-SNAPSHOT" //NOTE: my linux arm32 and arm64 build
val nodePlugin = "1.3.0" val nodePlugin = "1.3.0"
val dokkaPlugin = "1.4.0" val dokkaPlugin = "1.4.20"
val taskTreePlugin = "1.5" val taskTreePlugin = "1.5"
val kotlinBigNumVersion = "0.2.2" val kotlinBigNumVersion = "0.2.2"
val lazySodium = "4.3.1-SNAPSHOT" val lazySodium = "4.3.1-SNAPSHOT"

View File

@ -267,23 +267,7 @@ kotlin {
} }
tasks { tasks {
create<Jar>("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") { if (getHostOsName() == "linux" && getHostArchitecture() == "x86-64") {
val jvmTest by getting(Test::class) { val jvmTest by getting(Test::class) {

View File

@ -28,10 +28,10 @@ plugins {
id(PluginsDeps.mavenPublish) id(PluginsDeps.mavenPublish)
id(PluginsDeps.signing) id(PluginsDeps.signing)
id(PluginsDeps.node) version Versions.nodePlugin id(PluginsDeps.node) version Versions.nodePlugin
id(PluginsDeps.dokka)
id(PluginsDeps.taskTree) version Versions.taskTreePlugin id(PluginsDeps.taskTree) version Versions.taskTreePlugin
id(PluginsDeps.androidLibrary) id(PluginsDeps.androidLibrary)
id(PluginsDeps.kotlinAndroidExtensions) id(PluginsDeps.kotlinAndroidExtensions)
id(PluginsDeps.dokka)
} }
@ -586,35 +586,18 @@ tasks.whenTaskAdded {
tasks { tasks {
create<Jar>("javadocJar") {
dependsOn(dokkaJavadoc)
archiveClassifier.set("javadoc")
from(dokkaJavadoc.get().outputDirectory)
}
dokkaJavadoc {
println("Dokka !")
dokkaSourceSets {
named("commonMain") {
displayName.set("common")
platform.set(Platform.common)
}
}
}
dokkaHtml { dokkaHtml {
println("Dokka Html!") println("Dokka Html!")
dokkaSourceSets { dokkaSourceSets {
named("commonMain") { named("commonMain") {
// displayName.set("common") // displayName.set("common")
// platform.set(Platform.common) // platform.set(Platform.common)
moduleDisplayName.set("Kotlin Multiplatform Libsodium Bindings") moduleName.set("Kotlin Multiplatform Libsodium Bindings")
includes.from( includes.from(
"src/commonMain/kotlin/com.ionspin.kotlin.crypto/aead/Aead.md", "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/auth/Auth.md",
"src/commonMain/kotlin/com.ionspin.kotlin.crypto/box/Box.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") "src/commonMain/kotlin/com.ionspin.kotlin.crypto/CryptoModule.md")
displayName.set("Kotlin multiplatform") displayName.set("Kotlin multiplatform")
} }
@ -693,7 +676,6 @@ signing {
publishing { publishing {
publications.withType(MavenPublication::class) { publications.withType(MavenPublication::class) {
artifact(tasks["javadocJar"])
pom { pom {
name.set("Kotlin Multiplatform Crypto") name.set("Kotlin Multiplatform Crypto")
description.set("Kotlin Multiplatform Crypto library") description.set("Kotlin Multiplatform Crypto library")

View File

@ -34,7 +34,7 @@ pluginManagement {
} }
} }
enableFeaturePreview("GRADLE_METADATA") enableFeaturePreview("GRADLE_METADATA")
rootProject.name = "KotlinMultiplatformCrypto" rootProject.name = "KotlinMultiplatformLibsodium"
include("multiplatform-crypto-api") include("multiplatform-crypto-api")
include("multiplatform-crypto-libsodium-bindings") include("multiplatform-crypto-libsodium-bindings")
include("sample") include("sample")

View File

@ -14,5 +14,6 @@ echo "completed libsodium build"
cd .. cd ..
#and then libsodium bindings #and then libsodium bindings
./gradlew --no-daemon multiplatform-crypto-libsodium-bindings:build || exit 1 ./gradlew --no-daemon multiplatform-crypto-libsodium-bindings:build || exit 1
echo "Script completed"
exit 0 exit 0

View File

@ -14,5 +14,6 @@ echo "completed libsodium build"
cd .. cd ..
./gradlew --no-daemon multiplatform-crypto-libsodium-bindings:build || exit 1 ./gradlew --no-daemon multiplatform-crypto-libsodium-bindings:build || exit 1
./gradlew --no-daemon multiplatform-crypto-libsodium-bindings:publishMingwX64PublicationToSnapshotRepository || exit 1 ./gradlew --no-daemon multiplatform-crypto-libsodium-bindings:publishMingwX64PublicationToSnapshotRepository || exit 1
echo "Script completed"
exit 0 exit 0