Adding scalrmult_ native impl, starting work on sample
This commit is contained in:
7 files changed
+98
-24
No files matched your search
@@ -144,7 +144,7 @@ kotlin {
|
||||
implementation(kotlin(Deps.Common.stdLib))
|
||||
implementation(kotlin(Deps.Common.test))
|
||||
implementation(Deps.Common.kotlinBigNum)
|
||||
implementation(project(":multiplatform-crypto-delegated"))
|
||||
implementation(project(":multiplatform-crypto-libsodium-bindings"))
|
||||
}
|
||||
}
|
||||
val commonTest by getting {
|
||||
|
||||
@@ -1,28 +1,12 @@
|
||||
package com.ionspin.kotlin.crypto.sample
|
||||
|
||||
import com.ionspin.kotlin.crypto.Crypto
|
||||
import com.ionspin.kotlin.crypto.CryptoInitializerDelegated
|
||||
import com.ionspin.kotlin.crypto.CryptoPrimitives
|
||||
import com.ionspin.kotlin.crypto.hash.encodeToUByteArray
|
||||
import com.ionspin.kotlin.crypto.util.LibsodiumRandom
|
||||
import com.ionspin.kotlin.crypto.util.toHexString
|
||||
|
||||
|
||||
object Sample {
|
||||
fun runSample() {
|
||||
println("Initializing crypto library")
|
||||
CryptoInitializerDelegated.initializeWithCallback {
|
||||
blake2b()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun blake2b() {
|
||||
println("Blake2b updateable")
|
||||
val blake2bUpdateable = CryptoPrimitives.Blake2b.updateable()
|
||||
blake2bUpdateable.update("test".encodeToUByteArray())
|
||||
println(blake2bUpdateable.digest().toHexString())
|
||||
println("Blake2b stateless")
|
||||
val statelessResult = CryptoPrimitives.Blake2b.stateless("test".encodeToUByteArray())
|
||||
println("Blake2b stateless: ${statelessResult.toHexString()}")
|
||||
val random = LibsodiumRandom.buf(32)
|
||||
println("Random: ${random.toHexString()}")
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ import com.ionspin.kotlin.crypto.sample.Sample
|
||||
import kotlin.time.ExperimentalTime
|
||||
|
||||
@ExperimentalTime
|
||||
|
||||
fun main() {
|
||||
|
||||
Sample.runSample()
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import com.ionspin.kotlin.crypto.sample.Sample
|
||||
|
||||
|
||||
|
||||
fun main() {
|
||||
Sample.runSample()
|
||||
}
|
||||
Reference in new issue
Block a user