Adding secret stream impl, completed generichash impl
This commit is contained in:
1 parent
6f38a01195
commit
39f0817308
9 files changed
+162
-63
No files matched your search
+2
-5
@@ -6,14 +6,11 @@ package com.ionspin.kotlin.crypto.generichash
|
||||
* on 21-Aug-2020
|
||||
*/
|
||||
|
||||
data class GenericHashState(val hashLength: Int, val state: GenericHashStateInternal)
|
||||
data class GenericHashState(val hashLength: Int, val internalState: GenericHashStateInternal)
|
||||
|
||||
expect class GenericHashStateInternal
|
||||
|
||||
expect object GenericHashing {
|
||||
|
||||
|
||||
|
||||
expect object GenericHash {
|
||||
|
||||
fun genericHash(message : UByteArray, requestedHashLength: Int, key : UByteArray? = null) : UByteArray
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.ionspin.kotlin.crypto.secretstream
|
||||
|
||||
/**
|
||||
* Created by Ugljesa Jovanovic
|
||||
* ugljesa.jovanovic@ionspin.com
|
||||
* on 26-Aug-2020
|
||||
*/
|
||||
expect class SecretStreamState
|
||||
|
||||
data class SecretStreamStateAndHeader(val state: SecretStreamState, val header : UByteArray)
|
||||
|
||||
data class DecryptedDataAndTag(val decryptedData : UByteArray, val tag : UByte)
|
||||
|
||||
expect object SecretStream {
|
||||
|
||||
fun xChaCha20Poly1305InitPush(key: UByteArray) : SecretStreamStateAndHeader
|
||||
fun xChaCha20Poly1305Push(state : SecretStreamState, message: UByteArray, additionalData : UByteArray = ubyteArrayOf(), tag: UByte) : UByteArray
|
||||
fun xChaCha20Poly1305InitPull(key: UByteArray, header: UByteArray) : SecretStreamStateAndHeader
|
||||
fun xChaCha20Poly1305Pull(state : SecretStreamState, ciphertext: UByteArray, additionalData : UByteArray = ubyteArrayOf()) : DecryptedDataAndTag
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user