Added rekey and keygen to secretstream
This commit is contained in:
1 parent
91cd41c8c1
commit
d5b1e7f7f3
5 files changed
+49
-2
No files matched your search
+4
@@ -57,6 +57,10 @@ interface JsSodiumInterface {
|
||||
fun crypto_secretstream_xchacha20poly1305_init_pull(header: Uint8Array, key: Uint8Array) : dynamic
|
||||
fun crypto_secretstream_xchacha20poly1305_pull(state: dynamic, ciphertext: Uint8Array, additionalData: Uint8Array) : dynamic
|
||||
|
||||
//keygen and rekey
|
||||
fun crypto_secretstream_xchacha20poly1305_keygen() : Uint8Array
|
||||
fun crypto_secretstream_xchacha20poly1305_rekey(state: dynamic)
|
||||
|
||||
//util
|
||||
fun memzero(array: Uint8Array)
|
||||
|
||||
|
||||
+8
@@ -44,4 +44,12 @@ actual object SecretStream {
|
||||
|
||||
}
|
||||
|
||||
actual fun xChaCha20Poly1305Keygen(): UByteArray {
|
||||
return getSodium().crypto_shorthash_keygen().toUByteArray()
|
||||
}
|
||||
|
||||
actual fun xChaCha20Poly1305Rekey(state: SecretStreamState) {
|
||||
getSodium().crypto_secretstream_xchacha20poly1305_rekey(state)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user