Idea cinterop stopped working, again... fixed blake2b stateless segmentation
This commit is contained in:
1 parent
d380863a29
commit
1be0470745
4 files changed
+32
-36
No files matched your search
+3
-2
@@ -70,15 +70,16 @@ actual object Blake2bDelegatedStateless : Blake2bStateless {
|
||||
|
||||
override fun digest(inputMessage: UByteArray, key: UByteArray, hashLength: Int): UByteArray {
|
||||
val hashResult = UByteArray(MAX_HASH_BYTES)
|
||||
|
||||
val hashResultPinned = hashResult.pin()
|
||||
crypto_generichash(
|
||||
StableRef.create(hashResult).asCPointer().reinterpret(),
|
||||
hashResultPinned.addressOf(0),
|
||||
hashLength.convert(),
|
||||
inputMessage.toCValues(),
|
||||
inputMessage.size.convert(),
|
||||
key.toCValues(),
|
||||
key.size.convert() ?: 0UL
|
||||
)
|
||||
hashResultPinned.unpin()
|
||||
return hashResult
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user