Working sodium cinterop

This commit is contained in:
Ugljesa Jovanovic authored and Ugljesa Jovanovic committed 2020-05-24 20:41:32 +02:00
1 parent 3f7df6c651
commit cc2f392bb7
6 files changed
+22 -31

No files matched your search

+1 -2
View File
@@ -107,7 +107,6 @@ kotlin {
executable {
println("Optimized: $optimized")
optimized = true
}
}
}
@@ -188,7 +187,7 @@ kotlin {
implementation(kotlin(Deps.Common.test))
implementation(Deps.Common.coroutines)
implementation(Deps.Common.kotlinBigNum)
implementation(project(":multiplatform-crypto"))
implementation(project(":multiplatform-crypto-delegated"))
}
}
val commonTest by getting {
@@ -1,5 +1,4 @@
import com.ionspin.kotlin.crypto.keyderivation.argon2.Argon2Pure
import com.ionspin.kotlin.crypto.keyderivation.argon2.ArgonType
import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bDelegated
import kotlin.time.ExperimentalTime
import kotlin.time.measureTime
@@ -7,22 +6,7 @@ import kotlin.time.measureTime
@ExperimentalStdlibApi
fun main() {
println("Test")
val argon2Instance = Argon2Pure(
password = "Password",
salt = "RandomSalt",
parallelism = 1,
tagLength = 64U,
requestedMemorySize = 4096U,
numberOfIterations = 100,
key = "",
associatedData = "",
argonType = ArgonType.Argon2id
)
val time = measureTime {
val tag = argon2Instance.derive()
val tagString = tag.map { it.toString(16).padStart(2, '0') }.joinToString(separator = "")
val expectedTagString = "27c61b6538ef9f4a1250f8712cac09fc4329969295f9440249437d38c1617a005c2702d76a8a59e4cda2dfba48e1132261dacdfd31296945906992ea32f1d06e"
println("Tag: ${tagString}")
}
println("Time $time")
// Blake
val blake = Blake2bDelegated()
blake.digest()
}