Yes, you can call both from C #, assuming they are wrapped in extern "C" sections. I can’t give you a detailed PInvoke signature because I don’t have enough information on how the various parameters are related, but the following will work.
[DllImport("yourdllName.dll")]
public static extern void init(IntPtr initData, IntPtr key);
[DllImport("yourdllName.dll")]
public static extern IntPtr encrpyt(IntPtr inout, unsigned inuputSize, IntPtr key, unsigned secretKeySize);
Parts of information that would allow us to create a better signature
- Is returning allocated memory for encryption?
- # 1 ,
- , ?
- , / ?