Sample (and maybe something else too, idk) works now!!
This commit is contained in:
1 parent
e2a079f0d2
commit
083df8a73c
6 files changed
+432
-384
No files matched your search
+6
-3
@@ -1,7 +1,6 @@
|
||||
package ext.libsodium.com.ionspin.kotlin.crypto
|
||||
|
||||
|
||||
import com.ionspin.kotlin.crypto.box.BoxKeyPair
|
||||
import org.khronos.webgl.Uint8Array
|
||||
|
||||
/**
|
||||
@@ -11,9 +10,13 @@ import org.khronos.webgl.Uint8Array
|
||||
*/
|
||||
|
||||
@JsModule("libsodium-wrappers-sumo")
|
||||
external object JsSodiumInterface {
|
||||
|
||||
external object JsSodium: JsAny {
|
||||
@JsName("default")
|
||||
val default : JsSodiumInterface
|
||||
}
|
||||
|
||||
@JsModule("libsodium-wrappers-sumo")
|
||||
external object JsSodiumInterface: JsAny {
|
||||
@JsName("crypto_generichash")
|
||||
fun crypto_generichash(hashLength: Int, inputMessage: Uint8Array, key: Uint8Array): Uint8Array
|
||||
|
||||
|
||||
+2
-1
@@ -1,11 +1,12 @@
|
||||
package com.ionspin.kotlin.crypto
|
||||
|
||||
import ext.libsodium.com.ionspin.kotlin.crypto.JsSodium
|
||||
import ext.libsodium.com.ionspin.kotlin.crypto.JsSodiumInterface
|
||||
import ext.libsodium.com.ionspin.kotlin.crypto.JsSodiumLoader
|
||||
|
||||
var sodiumLoaded: Boolean = false
|
||||
|
||||
fun getSodium() : JsSodiumInterface = JsSodiumInterface
|
||||
fun getSodium() : JsSodiumInterface = JsSodium.default
|
||||
|
||||
fun getSodiumLoaded() : Boolean = sodiumLoaded
|
||||
|
||||
|
||||
Reference in new issue
Block a user