Handle ULong -> UInt conversions, update api to reflect stream_chacha20_ietf takes UInt for initial counter

This commit is contained in:
Ugljesa Jovanovic committed 2022-03-25 12:47:22 +01:00
1 parent ce868fc598
commit cd3ec109a3
8 files changed
+27 -9

No files matched your search

@@ -1236,7 +1236,7 @@ interface JnaLibsodiumInterface : Library {
message: ByteArray,
messageLength: Long,
nonce: ByteArray,
initialCounter : Long,
initialCounter : Int,
key: ByteArray
) : Int
@@ -32,7 +32,7 @@ actual object Stream {
actual fun chacha20IetfXorIc(
message: UByteArray,
nonce: UByteArray,
initialCounter: ULong,
initialCounter: UInt,
key: UByteArray
): UByteArray {
val result = UByteArray(message.size)
@@ -42,7 +42,7 @@ actual object Stream {
message.asByteArray(),
message.size.toLong(),
nonce.asByteArray(),
initialCounter.toLong(),
initialCounter.toInt(),
key.asByteArray()
)