Giter Club home page Giter Club logo

kotlin-multiplatform-libsodium's Introduction

Hi there ๐Ÿ‘‹

kotlin-multiplatform-libsodium's People

Contributors

ionspin avatar luca992 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kotlin-multiplatform-libsodium's Issues

Typo in README.md

"libsodium" is mistyped as "lisodium" in the Maven IDs in README.md.

nativeMain build error (commonMain -> mingwX64 native

Hi, I am trying to test the module on Multiplatform on android, iOS and native platform, Kmm project build fine for android and IOS project, but error with native Main.

simply added sourceSet of commonMain with

implementation("com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.7")

My mingwX64 setup is

mingwX64("native") { binaries { sharedLib { baseName = "libnative" } } }

Any idea?

`mtkSharedModule:nativeMain: Could not resolve com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.7.
Required by:
project :

Possible solution:

Implement JNA wrapper for libsodium

Currently using lazy sodium which seems to be rarely updated and latest release still has fixed bugs.

To resolve this JNA wrapper needs to be implemented either here or as a separate library for both Android and Java
This will require

Libsodium return values aren't checked in some (many) places

Hi

Looks like this wrapper does not check what libsodium returns on JVM. For example:

actual suspend fun initialize() {
sodiumJna = loadLibrary()
sodiumJna.sodium_init()
isPlatformInitialized = true
}

actual fun pwhash(
outputLength: Int,
password: String,
salt: UByteArray,
opsLimit: ULong,
memLimit: Int,
algorithm: Int
): UByteArray {
val hashedPassword = UByteArray(outputLength)
sodiumJna.crypto_pwhash(
hashedPassword.asByteArray(),
outputLength.toLong(),
password,
password.length.toLong(),
salt.asByteArray(),
opsLimit.toLong(),
memLimit.toLong(),
algorithm
)
return hashedPassword
}

Also on Native, although I'm not sure because I didn't ever use Kotlin/Native FFI:

crypto_generichash(
pinnedHash.toPtr(),
requestedHashLength.convert(),
pinnedMessage.toPtr(),
message.size.convert(),
pinnedKey?.toPtr(),
(key?.size ?: 0).convert()
)

It's not everywhere though, e.g. crypto_pwhash_str_verify has a check, although it is used to get the result of verification so check suggests itself.

As said in FAQ, -1 means call is failed. I think ignored failures can introduce a serious vulnerability, especially under memory pressure (e.g. as a result of a DoS).

I understand that it is pretty rare case, but protection from targeted attacks is worth something like that:

class LibsodiumException: Exception("Libsodium call failed")

fun Int.ensureSuccessful() {
  if(it != 0) throw LibsodiumException()
}

For usage in every applicable place:

 actual suspend fun initialize() { 
     sodiumJna = loadLibrary() 
     sodiumJna.sodium_init().ensureSuccessful()
     isPlatformInitialized = true 
 } 

(offtopic) Also, do you accept pull requests?

Release libsodium bindings 0.1.0

Libsodium bindings is functionally for an experimental 0.1.0 releaser. Following tasks need to be done to make it a proper release:

  • Complete documentation (#24)
  • Update README.md
  • Bump kotlin to 1.4.20

Production readiness

Hi

I had a small POC with it in android, iOS, web, looks great
Would love to use it in real application,

Actually I might use it or fork it then use it if this would give some real use case to the lib

Have couple of question

  • Do you have a timeline when you planning to go to prod with the lib ? ,
  • Are you currently using this lib in your own projects ?
  • if you need help with any check list you planning to finish before finalising, please share ,
  • In the docs you mention introducing new attack surfaces, can you please elaborate on this ? If it's just a wrapper how it can be abused ?

sorry i'm using issues to communicate ๐Ÿ˜ฌ

JS libsodium won't initalize

On JS I can't get initialize() to work. It fails with this error:

ReferenceError: $module$libsodium_wrappers_sumo is not defined
	at 0.doResume_5yljmg(/var/folders/q4/bk4942ys3g5_gsbchw20c6k00000gn/T/_karma_webpack_796110/commons.js:294177)
	at JsSodiumLoader.load_e5ock0(/var/folders/q4/bk4942ys3g5_gsbchw20c6k00000gn/T/_karma_webpack_796110/commons.js:294230)
	at 1.doResume_5yljmg(/var/folders/q4/bk4942ys3g5_gsbchw20c6k00000gn/T/_karma_webpack_796110/commons.js:294370)
	at LibsodiumInitializer.initialize_slkfnq(/var/folders/q4/bk4942ys3g5_gsbchw20c6k00000gn/T/_karma_webpack_796110/commons.js:294405)
	at slambda.doResume_5yljmg(/var/folders/q4/bk4942ys3g5_gsbchw20c6k00000gn/T/_karma_webpack_796110/commons.js:303806)
	at slambda.invoke_nx893v(/var/folders/q4/bk4942ys3g5_gsbchw20c6k00000gn/T/_karma_webpack_796110/commons.js:303792)
	at slambda.$testBody(/var/folders/q4/bk4942ys3g5_gsbchw20c6k00000gn/T/_karma_webpack_796110/commons.js:303861)
	at slambda.doResume_5yljmg(/var/folders/q4/bk4942ys3g5_gsbchw20c6k00000gn/T/_karma_webpack_796110/commons.js:302120)
	at slambda.invoke_c8cfpt(/var/folders/q4/bk4942ys3g5_gsbchw20c6k00000gn/T/_karma_webpack_796110/commons.js:302106)
	at <global>.l(/var/folders/q4/bk4942ys3g5_gsbchw20c6k00000gn/T/_karma_webpack_796110/commons.js:302158)

Any idea what is going on? (this is in a test function, if that matters) Maybe it has to do with webpack5?

Add documentation to libsodium bindings API

Describe the bug
Documentation of the Libsodium bindings API is either completely missing, or a direct copy from libsodium website

To Reproduce
Look at the API documentation

Expected behavior
A documentation explaining what a method/function does precisely

Platform

  • All

Tasks:
Add .md description for each functionality group and add documentation for each function in the group

  • aead
  • auth
  • box
  • generichash
  • hash
  • kdf
  • keyexchange
  • pwhash
  • scalarmult
  • secretbox
  • secretstream
  • shortinputhash
  • signature
  • stream
  • util

Adding dependency in `commonMain` doesn't work the JS legacy target

After adding the dependency to the commonMain sourceset, build fails with the following error:

Could not determine the dependencies of task ':jsPackageJson'.
> Could not resolve all dependencies for configuration ':jsNpm'.
   > Could not resolve com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4.
     Required by:
         project :
      > No matching variant of com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4 was found. The consumer was configured to find a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js', attribute 'org.jetbrains.kotlin.js.compiler' with value 'legacy' but:
          - Variant 'debugApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'debugRuntimeElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4 declares a runtime of a component:
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'iosArm32ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'iosArm64ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'iosX64ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'jsApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4 declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.js.compiler' with value 'legacy'
          - Variant 'jsRuntimeElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4 declares a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.js.compiler' with value 'legacy'
          - Variant 'jvmApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'jvmRuntimeElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4 declares a runtime of a component:
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'linuxArm64ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'linuxX64ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'macosX64ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'metadataApiElements' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'mingwX64ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'releaseApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'releaseRuntimeElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4 declares a runtime of a component:
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'tvosArm64ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'tvosX64ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'watchosArm32ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'watchosArm64ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')
          - Variant 'watchosX86ApiElements-published' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.4:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attribute:
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'legacy')

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.


Is JS legacy not supported by this library? Are there any workarounds?

Wrong Libsodium function in Signature.ed25519PkToCurve25519

First, thanks for the great work on the library.

We had issues with derived public keys that did match what we got from other Libsodium libraries.

Digging deeper (thanks to @andreapizzato) we found that the crypto_sign_ed25519_sk_to_curve25519 has been used to convert public keys instead of crypto_sign_ed25519_sk_to_curve25519

So in the Signature object the ed25519PkToCurve25519 is using the wrong Libsodium function.

actual object Signature {
...
    /**
         * The sodiumJna.crypto_sign_ed25519_pk_to_curve25519() function converts an Ed25519 public key ed25519_pk to an X25519 public key and stores it into x25519_pk.
         */
        actual fun ed25519PkToCurve25519(ed25519PublicKey: UByteArray) : UByteArray {
            val x25519PublicKey = UByteArray(crypto_scalarmult_curve25519_BYTES)
            sodiumJna.crypto_sign_ed25519_sk_to_curve25519(
                x25519PublicKey.asByteArray(),
                ed25519PublicKey.asByteArray()
            )
            return x25519PublicKey
        }
    
        actual fun ed25519SkToCurve25519(ed25519SecretKey: UByteArray) : UByteArray {
            val x25519SecretKey = UByteArray(crypto_scalarmult_curve25519_BYTES)
            sodiumJna.crypto_sign_ed25519_sk_to_curve25519(
                x25519SecretKey.asByteArray(),
                ed25519SecretKey.asByteArray()
            )
            return x25519SecretKey
        }
    ...
}

Linker error running on iPhone Simulator x86_64 using 0.8.8

After updating to 0.8.8 when I develop a multiplatform project and I try to run some SwiftUI previews I got:

linker command failed with exit code 1 (use -v to see invocation)

----------------------------------------

LinkDylibError: Failed to build SingleSelectionList.swift

Linking failed: linker command failed with exit code 1 (use -v to see invocation)

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator'
Undefined symbols for architecture x86_64:
  "_crypto_core_salsa2012", referenced from:
      _libsodium_crypto_core_salsa2012_wrapper169 in DodiKit(result.o)
     (maybe you meant: knifunptr_libsodium168_crypto_core_salsa2012_constbytes, _libsodium_crypto_core_salsa2012_outputbytes_wrapper165 , knifunptr_libsodium165_crypto_core_salsa2012_outputbytes , _libsodium_crypto_core_salsa2012_constbytes_wrapper168 , knifunptr_libsodium167_crypto_core_salsa2012_keybytes , _libsodium_crypto_core_salsa2012_keybytes_wrapper167 , knifunptr_libsodium166_crypto_core_salsa2012_inputbytes , _libsodium_crypto_core_salsa2012_inputbytes_wrapper166 , _libsodium_crypto_core_salsa2012_wrapper169 , knifunptr_libsodium169_crypto_core_salsa2012 )
  "_crypto_core_salsa2012_constbytes", referenced from:
      _libsodium_crypto_core_salsa2012_constbytes_wrapper168 in DodiKit(result.o)
     (maybe you meant: knifunptr_libsodium168_crypto_core_salsa2012_constbytes, _libsodium_crypto_core_salsa2012_constbytes_wrapper168 )
  "_crypto_core_salsa2012_inputbytes", referenced from:
      _libsodium_crypto_core_salsa2012_inputbytes_wrapper166 in DodiKit(result.o)
     (maybe you meant: knifunptr_libsodium166_crypto_core_salsa2012_inputbytes, _libsodium_crypto_core_salsa2012_inputbytes_wrapper166 )
  "_crypto_core_salsa2012_keybytes", referenced from:
      _libsodium_crypto_core_salsa2012_keybytes_wrapper167 in DodiKit(result.o)
     (maybe you meant: knifunptr_libsodium167_crypto_core_salsa2012_keybytes, _libsodium_crypto_core_salsa2012_keybytes_wrapper167 )
  "_crypto_core_salsa2012_outputbytes", referenced from:
      _libsodium_crypto_core_salsa2012_outputbytes_wrapper165 in DodiKit(result.o)
     (maybe you meant: _libsodium_crypto_core_salsa2012_outputbytes_wrapper165, knifunptr_libsodium165_crypto_core_salsa2012_outputbytes )
  "_crypto_core_salsa208", referenced from:
      _libsodium_crypto_core_salsa208_wrapper174 in DodiKit(result.o)
     (maybe you meant: knifunptr_libsodium174_crypto_core_salsa208, _libsodium_crypto_core_salsa208_inputbytes_wrapper171 , _libsodium_crypto_core_salsa208_constbytes_wrapper173 , knifunptr_libsodium170_crypto_core_salsa208_outputbytes , knifunptr_libsodium171_crypto_core_salsa208_inputbytes , knifunptr_libsodium172_crypto_core_salsa208_keybytes , _libsodium_crypto_core_salsa208_keybytes_wrapper172 , knifunptr_libsodium173_crypto_core_salsa208_constbytes , _libsodium_crypto_core_salsa208_wrapper174 , _libsodium_crypto_core_salsa208_outputbytes_wrapper170 )
  "_crypto_core_salsa208_constbytes", referenced from:
      _libsodium_crypto_core_salsa208_constbytes_wrapper173 in DodiKit(result.o)
     (maybe you meant: _libsodium_crypto_core_salsa208_constbytes_wrapper173, knifunptr_libsodium173_crypto_core_salsa208_constbytes )
  "_crypto_core_salsa208_inputbytes", referenced from:
      _libsodium_crypto_core_salsa208_inputbytes_wrapper171 in DodiKit(result.o)
     (maybe you meant: _libsodium_crypto_core_salsa208_inputbytes_wrapper171, knifunptr_libsodium171_crypto_core_salsa208_inputbytes )
  "_crypto_core_salsa208_keybytes", referenced from:
      _libsodium_crypto_core_salsa208_keybytes_wrapper172 in DodiKit(result.o)
     (maybe you meant: knifunptr_libsodium172_crypto_core_salsa208_keybytes, _libsodium_crypto_core_salsa208_keybytes_wrapper172 )
  "_crypto_core_salsa208_outputbytes", referenced from:
      _libsodium_crypto_core_salsa208_outputbytes_wrapper170 in DodiKit(result.o)
     (maybe you meant: knifunptr_libsodium170_crypto_core_salsa208_outputbytes, _libsodium_crypto_core_salsa208_outputbytes_wrapper170 )
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It was working before.

android minSDK level

Hi! @ionspin
Thank you always for your prompt support. Just a question regarding android minimum SDK level.
The library requires minSDK level of 24, is there a specific reason for the minSDK level? Could it be lower to 21 instead?
That would make this library be more widely accepted.

Unable to run tests on jvm target in project that includes this library

When I use it in my project, I'm unable to run tests with JUnit on JVM target. JS works fine.

I'm getting this error:
`
Execution failed for task ':crypto:jvmTest'.

Could not resolve all files for configuration ':crypto:jvmTestRuntimeClasspath'.
Could not resolve org.jetbrains.kotlin:kotlin-test-junit5:1.7.10.
Required by:
project :crypto > org.jetbrains.kotlin:kotlin-test:1.7.10
> Module 'org.jetbrains.kotlin:kotlin-test-junit5' has been rejected:
Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.7.10' also provided by [org.jetbrains.kotlin:kotlin-test-junit:1.6.20-RC2(junitRuntime)]
Could not resolve org.jetbrains.kotlin:kotlin-test-junit:1.6.20-RC2.
Required by:
project :crypto > com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.6 > com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings-jvm:0.8.6
> Module 'org.jetbrains.kotlin:kotlin-test-junit' has been rejected:
Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.6.20-RC2' also provided by [org.jetbrains.kotlin:kotlin-test-junit5:1.7.10(junit5Runtime)]

This is how I include it:

sourceSets {
        val coroutinesVersion: String by System.getProperties()
        val kotlinVersion: String by System.getProperties()
        val commonMain by getting {
            dependencies {
                implementation(project(":buffer"))
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
                implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
                implementation("com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.8.6")

            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test"))
            }
        }
        val jvmMain by getting {
            dependencies {
            }
        }
        val jvmTest by getting
        val jsMain by getting {
            dependencies {
                implementation(npm("js-base64", "^3.7.2", generateExternals = true))
                implementation(npm("@peculiar/webcrypto", "^1.4.0", generateExternals = true))
            }

        }

        val jsTest by getting
    }

I think that it's caused by Deps.Common.test included in commonMain of the library. Wdyt? Is it necessary for something?
https://github.com/ionspin/kotlin-multiplatform-libsodium/blob/main/multiplatform-crypto-api/build.gradle.kts#L121

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.