This commit is contained in:
Ugljesa Jovanovic authored and Ugljesa Jovanovic committed 2020-06-06 00:41:00 +02:00
1 parent 3ad86e284a
commit 907128fcfa
5 files changed
+76 -28

No files matched your search

@@ -8,10 +8,21 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
object Sample {
suspend fun runSample() {
Crypto.initialize()
fun runSample() {
println("Initializing crypto library")
Crypto.initializeWithCallback {
blake2b()
}
}
fun blake2b() {
println("Blake2b updateable")
val blake2bUpdateable = Crypto.Blake2b.updateable()
blake2bUpdateable.update("test")
println(blake2bUpdateable.digest().toHexString())
println("Blake2b stateless")
println("Blake2b stateless: ${Crypto.Blake2b.stateless("test")}")
}
}
@@ -1,21 +1,21 @@
import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bDelegated
import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bStateless
import com.ionspin.kotlin.crypto.sample.Sample
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import platform.posix.pthread_self
import platform.posix.sleep
import kotlin.native.concurrent.TransferMode
import kotlin.native.concurrent.Worker
import kotlin.time.ExperimentalTime
import kotlin.time.measureTime
@ExperimentalTime
fun main() = runBlocking {
fun main() {
Sample.runSample()
// println("Test")
//// Blake
// val blake = Blake2bDelegated()
// val res = blake.digest()
// println("Result of res")
//// println(res)
// val staticRes = Blake2bStateless.digest("test")
// println("Result:")
// println(staticRes)
}