using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace INT69DC_7C.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);
    }
}
