JoakimForslund
08/27/2019, 9:14 AMpublic fun AES_CBC_encrypt_buffer(output: kotlinx.cinterop.CValuesRef<platform.posix.uint8_tVar /* = kotlinx.cinterop.UByteVarOf<platform.posix.uint8_t /* = kotlin.UByte */> */>?, input: kotlinx.cinterop.CValuesRef<platform.posix.uint8_tVar /* = kotlinx.cinterop.UByteVarOf<platform.posix.uint8_t /* = kotlin.UByte */> */>?, length: platform.posix.uint32_t /* = kotlin.UInt */, key: kotlinx.cinterop.CValuesRef<platform.posix.uint8_tVar /* = kotlinx.cinterop.UByteVarOf<platform.posix.uint8_t /* = kotlin.UByte */> */>?, iv: kotlinx.cinterop.CValuesRef<platform.posix.uint8_tVar /* = kotlinx.cinterop.UByteVarOf<platform.posix.uint8_t /* = kotlin.UByte */> */>?): kotlin.Unit { /* compiled code */ }
I'm trying to use it with the following setup: https://gist.github.com/Syrou/52db691f91928cb6aad6bcfd84bf5cff
1. Am I wrong in trying to use toCValues() method to translate the uByteArrays into what is specified in the method argument?
2. Am I using the buffer pinning wrong?
Because each time I run this code I end up with a new result. This might
be an error in the c-lib to start with, but I'm currently investigating if my implementation of the native code is wrong.Artyom Degtyarev [JB]
08/27/2019, 9:21 AMJoakimForslund
08/27/2019, 9:26 AMJoakimForslund
08/27/2019, 11:05 AMJoakimForslund
08/27/2019, 1:25 PM