Oleg Yukhnevich
02/07/2023, 10:35 PM"String".cstr.ptr
to be able to pass it to C functions. But still even such code will not work:
OSSL_PARAM_construct_utf8_string("digest", hashAlgorithm.cstr.ptr, 0).ptr
I’ve tried to pin "digest"
string, but this also doesn’t work
And only when Im almost surrendered I saw this: noStringConversion
- https://kotlinlang.org/docs/native-c-interop.html#strings
I’ve tried and surprisingly this works. Call now looks like this (even so it’s const char*
in C, now we need to path pointers all time instead os strings in such calls)
OSSL_PARAM_construct_utf8_string("digest".cstr.ptr, hashAlgorithm.cstr.ptr, 0).ptr
Im not an expert in C and cinterop, but for me it looks like a bug in cinterop generated bindings under the hood.
Should I fill an issue, or is it expected behaviour?