ITC81DB_2H/ITC81DB_0H/Part11_Encryption/Encryption.Define.cs

35 lines
1.3 KiB
C#

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace ITC81DB_0H.Part11_Encryption
{
public partial class Encryption
{
private const string PathDll = "SD Card\\Run\\DllAes128.dll";
private delegate void fnAesVersionCB(StringBuilder version);
private static fnAesVersionCB fnAesVersionCallBack;
public delegate void fnAesEncryptionCB(ref auth_encryption_status_t encryption_status);
public static fnAesEncryptionCB fnAesEncryptionCallBack;
[DllImport(PathDll, CallingConvention = CallingConvention.Winapi)]
private static extern void DLL_AES_Register_VersionCB(fnAesVersionCB func);
[DllImport(PathDll, CallingConvention = CallingConvention.Winapi)]
public static extern void DLL_AES_Register_EncryptionCB(fnAesEncryptionCB func);
[DllImport(PathDll, CallingConvention = CallingConvention.Winapi)]
private static extern void DLL_SAES_Getversion();
[DllImport(PathDll, CallingConvention = CallingConvention.Winapi)]
public static extern void DLL_AES_Activation();
[DllImport(PathDll, CallingConvention = CallingConvention.Winapi)]
public static extern int DLL_AES_Encryption(IntPtr inFileName, IntPtr outFileName, bool encrypt, bool compress);
}
}