Add generic hash tests, add templates for secret stream jvm and js
This commit is contained in:
1 parent
39f0817308
commit
2c92a8142f
5 files changed
+148
-2
No files matched your search
+1
-1
@@ -30,7 +30,7 @@ actual object GenericHash {
|
||||
requestedHashLength: Int,
|
||||
key: UByteArray?
|
||||
): GenericHashState {
|
||||
val state = getSodium().crypto_generichash_init(key.toUInt8Array(), requestedHashLength)
|
||||
val state = getSodium().crypto_generichash_init(key?.toUInt8Array() ?: Uint8Array(0), requestedHashLength)
|
||||
return GenericHashState(requestedHashLength, state)
|
||||
}
|
||||
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.ionspin.kotlin.crypto.secretstream
|
||||
|
||||
actual typealias SecretStreamState = Any
|
||||
|
||||
actual object SecretStream {
|
||||
actual fun xChaCha20Poly1305InitPush(key: UByteArray): SecretStreamStateAndHeader {
|
||||
TODO("not implemented yet")
|
||||
}
|
||||
|
||||
actual fun xChaCha20Poly1305Push(
|
||||
state: SecretStreamState,
|
||||
message: UByteArray,
|
||||
additionalData: UByteArray,
|
||||
tag: UByte
|
||||
): UByteArray {
|
||||
TODO("not implemented yet")
|
||||
}
|
||||
|
||||
actual fun xChaCha20Poly1305InitPull(
|
||||
key: UByteArray,
|
||||
header: UByteArray
|
||||
): SecretStreamStateAndHeader {
|
||||
TODO("not implemented yet")
|
||||
}
|
||||
|
||||
actual fun xChaCha20Poly1305Pull(
|
||||
state: SecretStreamState,
|
||||
ciphertext: UByteArray,
|
||||
additionalData: UByteArray
|
||||
): DecryptedDataAndTag {
|
||||
TODO("not implemented yet")
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user