Adding data classes
This commit is contained in:
17 files changed
+263
-375
No files matched your search
@@ -2,6 +2,7 @@ package debug.test
|
||||
|
||||
import com.goterl.lazycode.lazysodium.SodiumJava
|
||||
import com.goterl.lazycode.lazysodium.interfaces.Hash
|
||||
import com.goterl.lazycode.lazysodium.interfaces.SecretStream
|
||||
import kotlin.ByteArray
|
||||
import kotlin.Int
|
||||
import kotlin.UByteArray
|
||||
@@ -14,7 +15,13 @@ actual typealias Sha512State = Hash.State512
|
||||
|
||||
actual typealias GenericHashState = ByteArray
|
||||
|
||||
actual typealias SecretStreamState = SecretStream.State
|
||||
|
||||
actual class Crypto internal actual constructor() {
|
||||
/**
|
||||
* Initialize the SHA256 hash
|
||||
* returns sha 256 state
|
||||
*/
|
||||
actual fun crypto_hash_sha256_init(): Sha256State {
|
||||
val state = debug.test.Sha256State()
|
||||
println("Debug crypto_hash_sha256_init")
|
||||
@@ -59,4 +66,10 @@ actual class Crypto internal actual constructor() {
|
||||
sodium.crypto_generichash_init(state, key.asByteArray(), key.size, outlen)
|
||||
return state
|
||||
}
|
||||
|
||||
actual fun crypto_secretstream_xchacha20poly1305_init_push(key: UByteArray): UByteArray {
|
||||
println("Debug crypto_secretstream_xchacha20poly1305_init_push")
|
||||
sodium.crypto_secretstream_xchacha20poly1305_init_push(key.asByteArray())
|
||||
return state
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user