Working sodium cinterop
This commit is contained in:
1 parent
3f7df6c651
commit
cc2f392bb7
6 files changed
+22
-31
No files matched your search
+5
-3
@@ -1,6 +1,7 @@
|
||||
package com.ionspin.kotlin.crypto.hash.blake2b
|
||||
import interop.*
|
||||
import kotlinx.cinterop.*
|
||||
import libsodium.*
|
||||
/**
|
||||
* Created by Ugljesa Jovanovic
|
||||
* ugljesa.jovanovic@ionspin.com
|
||||
@@ -9,8 +10,7 @@ import kotlinx.cinterop.*
|
||||
|
||||
@ExperimentalUnsignedTypes
|
||||
actual class Blake2bDelegated actual constructor(key: UByteArray?, hashLength: Int) : Blake2b {
|
||||
override val MAX_HASH_BYTES: Int
|
||||
get() = TODO("not implemented yet")
|
||||
override val MAX_HASH_BYTES: Int = 1024
|
||||
|
||||
override fun update(data: UByteArray) {
|
||||
TODO("not implemented yet")
|
||||
@@ -21,7 +21,9 @@ actual class Blake2bDelegated actual constructor(key: UByteArray?, hashLength: I
|
||||
}
|
||||
|
||||
override fun digest(): UByteArray {
|
||||
TODO("not implemented yet")
|
||||
val result = sodium_init()
|
||||
println("Sodium init $result")
|
||||
return ubyteArrayOf(0U)
|
||||
}
|
||||
|
||||
override fun digestString(): String {
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ class Blake2bLinuxTest {
|
||||
@Test
|
||||
fun testCinterop() {
|
||||
val sodiumInitResult = sodium_init()
|
||||
// println("Sodium init $sodiumInitResult")
|
||||
println("Sodium init $sodiumInitResult")
|
||||
println("1")
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
headers = sodium.h
|
||||
headerFilter = sodium.h sodium/**
|
||||
staticLibraries = libsodium.a
|
||||
libraryPaths = /usr/lib
|
||||
compilerOpts = -Iinclude -I/usr/include
|
||||
linkerOpts = -L/usr/lib -lsodium
|
||||
libraryPaths = /home/ionspin/Projects/Future/sodiumWrapper/lib
|
||||
compilerOpts = -I/home/ionspin/Projects/Future/sodiumWrapper/include
|
||||
linkerOpts =
|
||||
Reference in new issue
Block a user