Add state cleanup for delegated and pure. There doesn't seem to be a easy way to clean js state

This commit is contained in:
Ugljesa Jovanovic authored and Ugljesa Jovanovic committed 2020-07-10 22:08:08 +02:00
1 parent 1293b9ea75
commit 52b6a4ad8e
11 files changed
+51 -6

No files matched your search

@@ -52,5 +52,9 @@ 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
//util
fun memzero(array: Uint8Array)
}
@@ -121,6 +121,10 @@ actual class XChaCha20Poly1305Delegated internal actual constructor() {
return decrypted.toUByteArray()
}
actual fun cleanup() {
//TODO JS cleanup
}
}