Adding secretstream push definition and neccessary changes

This commit is contained in:
Ugljesa Jovanovic committed 2020-08-14 16:00:30 +02:00
1 parent efe9661c30
commit 28995c065f
9 files changed
+195 -31

No files matched your search

@@ -1,6 +1,7 @@
package debug.test
import kotlin.Int
import kotlin.UByte
import kotlin.UByteArray
expect class Sha256State
@@ -35,5 +36,19 @@ expect class Crypto internal constructor() {
fun crypto_generichash_init(key: UByteArray, outlen: Int): GenericHashState
fun crypto_secretstream_xchacha20poly1305_init_push(key: UByteArray): UByteArray
/**
* Initialize a state and generate a random header. Both are returned inside
* `SecretStreamStateAndHeader` object
*/
fun crypto_secretstream_xchacha20poly1305_init_push(key: UByteArray): SecretStreamStateAndHeader
/**
* Encrypt next block of data using the previously initialized state. Returns encrypted block.
*/
fun crypto_secretstream_xchacha20poly1305_push(
state: SecretStreamState,
m: UByteArray,
ad: UByteArray,
tag: UByte
): UByteArray
}