     -> `ShonkyCryptContext' newShonkyCryptContextPointer * #}
 
 type InPlaceEnDeCryptFun =
-     Ptr ShonkyCryptContext -> Ptr CChar -> Ptr CChar -> CULong -> IO ()
+     Ptr ShonkyCryptContext -> Ptr CChar -> Ptr CChar -> CSizeT -> IO ()
 type NewEnDeCryptFun =
-     Ptr ShonkyCryptKey -> Ptr CChar -> CULong -> IO CString
+     Ptr ShonkyCryptKey -> Ptr CChar -> CSizeT -> IO CString
 
 scEnDeCryptInplace :: InPlaceEnDeCryptFun
                    -> ShonkyCryptContext

import Data.ByteString (ByteString)
import Data.Word (Word8)
import Foreign.C.String (CStringLen, CString)
import Foreign.C.Types (CChar(..), CULong(..), CDouble(..))
import Foreign.ForeignPtr
import Foreign.Marshal.Alloc (mallocBytes, free)
import Foreign.Marshal.Utils (with, fromBool, toBool)

    ^ { withTrickC2HS *`ShonkyCryptKey' }
    -> `ShonkyCryptContext' newShonkyCryptContextPointer * #}

withByteStringLen :: ByteString -> ((CString, CSizeT) -> IO a) -> IO a
withByteStringLen str f = BSU.unsafeUseAsCStringLen str (\(cstr, len) ->
    f (cstr, fromIntegral len))

