'Thanks to James Clark for providing this file to DevOTechS
'==========================================================

// CONTENTS OF frmMain.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HIME_DEMO
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // Allocate 3 registers
            int reg1 = HIME.hi_RegAllocate();
            int reg2 = HIME.hi_RegAllocate();
            int reg3 = HIME.hi_RegAllocate();

            // Register HIME so that it doesn't show the nagscreen anymore
            // a) Store your registration key in a register
            HIME.hi_PutReg("222-33334444", reg1); // <--Use your real registration key here
            // b) Register HIME
            HIME.hi_Register(reg1);

            // Alternative syntax:
            int i;
            // a) Store your registration key in a register
            i = HIME.hi_PutReg("222-33334444", reg1); // <--Use your real registration key here
            // b) Register HIME
            i = HIME.hi_Register(reg1);

            // Simple addition of 999999999 + 111111111 = 1111111110
            // Load first value in reg1
            HIME.hi_PutReg("999999999", reg1);
            // Convert first value to Huge
            HIME.hi_Dec2Huge(reg1, reg1);
            // Load second value in reg2
            HIME.hi_PutReg("111111111", reg2);
            // Convert second value to Huge
            HIME.hi_Dec2Huge(reg2, reg2);
            // Add the two registers together, result to reg3
            HIME.hi_Add(reg1, reg2, reg3);
            // Convert third register to decimal
            HIME.hi_Huge2Dec(reg3, reg3);
            // Retrieve decimal contents of third register into a StringBuilder
            StringBuilder HugeSum = HIME.hi_GetReg(reg3);
            // Display the decimal value of the result in the Output Console window
            Console.WriteLine("HugeSum = {0}", HugeSum.ToString());
            // Unallocate the three registers
            HIME.hi_RegUnallocateRange(reg1, reg3);
        }
    }
}

//CONTENTS OF Program.cs
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Runtime.InteropServices; //added for [DllImport] attribute
using System.Text;  //added for StringBuilder class

namespace HIME_DEMO
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMain());
        }
    }
    public static class HIME
    {
        #region HIME function declarations
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ADD(
                ref int lReg1,
                ref int lReg2,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_BASE642HUGE(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_BIN2HUGE(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_BREAKSTRING(
                ref int lRegIn, ref int CharsInChunk,
                ref int NrOfSpaces,
                ref int ChunksInLine,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_CHECKTESTVECTORS_AES();
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_CHECKTESTVECTORS_ARC4();
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_CHECKTESTVECTORS_MD5();
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_CHECKTESTVECTORS_SHA_1();
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            static extern int HI_CHECKTESTVECTORS_SHA_256();
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_COPYREG(
                ref int lRegSource,
                ref int lRegTarget);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DEC2HUGE(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DECR(
                ref int lReg1,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DECRYPT_AES_1BLOCK(
                ref int lReg_Cipher,
                ref int lReg_Key,
                ref int lReg_Plain);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DECRYPT_AES_CBC(
                ref int lReg_Cipher,
                ref int lReg_Key,
                ref int lReg_Plain);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DECRYPT_AES_ECB(
                ref int lReg_Cipher,
                ref int lReg_Key,
                ref int lReg_Plain);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DECRYPT_ARC4(
                ref int lReg_Cipher,
                ref int lReg_Key,
                ref int lReg_Plain,
                ref int BytesToDiscard);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DECRYPT_RSA(
                ref int lReg_Cipher,
                ref int lReg_hd,
                ref int lReg_hModul,
                ref int lReg_Plain);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DH_GENPARAMS(
                ref int lBitLength,
                ref int lRegP,
                ref int lRegG);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DH_STEP1(
                ref int lRegP,
                ref int lRegG,
                ref int lPriv,
                ref int lPub);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DH_STEP2(
                ref int lRegP,
                ref int lPub,
                ref int lPriv,
                ref int lShared);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DIV(
                ref int lReg1,
                ref int lReg2,
                ref int lReg_Quot,
                ref int lReg_Rem);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_DIVBY2(
                ref int lReg1,
                ref int lReg_Quot,
                ref int lReg_Rem);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ENCRYPT_AES_1BLOCK(
                ref int lReg_Plain,
                ref int lReg_Key,
                ref int lReg_Cipher);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ENCRYPT_AES_CBC(
                ref int lReg_Plain,
                ref int lReg_Key,
                ref int lReg_IV,
                ref int lReg_Cipher);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ENCRYPT_AES_ECB(
                ref int lReg_Plain,
                ref int lReg_Key,
                ref int lReg_Cipher);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ENCRYPT_ARC4(
                ref int lReg_Plain,
                ref int lReg_Key,
                ref int lReg_Cipher,
                ref int BytesToDiscard);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ENCRYPT_RSA(
                ref int lReg_Plain,
                ref int lReg_he,
                ref int lReg_hModul,
                ref int lReg_Cipher);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_GCD(
                ref int lReg1,
                ref int lReg2,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_GENERATEBBSRANDOMBITS(
                ref int lBytes,
                ref int lMultipleBits,
                ref int lReg_SSeed,
                ref int lReg_Modul,
                ref int lReg_Result,
                ref int lReg_ESeed);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_GENERATEPRIME(
                ref int lLengthBits,
                ref int lPrimeTests,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_GENERATERANDOM(
                ref int lLengthBits,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_GENERATERSAKEYS(
                ref int lBitLength,
                ref int lPrimeTests,
                ref int lReg_he,
                ref int lReg_hd,
                ref int lReg_Modul);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_GENERATERSARANDOMBITS(
                ref int lBytes,
                ref int lReg_SSeed,
                ref int lReg_he,
                ref int lReg_Modul,
                ref int lReg_Result,
                ref int lReg_EndSeed);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_GETGLOBALERROR();
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_GETOPTION(
                ref int lOption,
                ref int lParam);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_GETREGADD(
                ref int lReg,
                ref StringBuilder lAddress,
                ref int lLen);
            //HI_GETREGASCIIZ1 Not Used
            //HI_GETREGASCIIZ2 Not Used
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_GETREGBYTE(
                ref int lReg,
                ref int index);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_HASH_CRC32(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_HASH_MD5(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_HASH_SHA_1(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_HASH_SHA_256(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_HEX2HUGE(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_HUGE2BASE64(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_HUGE2BIN(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_HUGE2DEC(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_HUGE2HEX(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_INCR(
                ref int lReg1,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_INITBBS(
                ref int lBitLength,
                ref int lPrimeTests,
                ref int lReg_Modul,
                ref int lReg_Seed);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISEQUAL(
                ref int lReg1,
                ref int lReg2);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISLESS(
                ref int lReg1,
                ref int lReg2);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISNOTEQUAL(
                ref int lReg1,
                ref int lReg2);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISODD(
                ref int lReg1);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISPRIME_DIV(
                ref int lReg1);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISPRIME_F(
                ref int lTests,
                ref int lReg1);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISPRIME_RB(
                ref int lTests,
                ref int lReg1);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISPRIME_SLOW(
                ref int lReg1);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISREGALLOCATED(
                ref int lReg);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISRELPRIME(
                ref int lReg1,
                ref int lReg2);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_ISZERO(
                ref int lReg1);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_MOD(
                ref int lReg1,
                ref int lReg2,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_MODINV(
                ref int lReg1,
                ref int lReg2,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_MUL(
                ref int lReg1,
                ref int lReg2,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_MULBY2(
                ref int lReg1,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_POW(
                ref int lReg1,
                ref int lReg2,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_POWMOD(
                ref int lReg1,
                ref int lReg2,
                ref int lReg3,
                ref int lReg_Result);
            //HI_PUTREG Not Used
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_PUTREGADD(
                ref string lAddress,
                ref int lLen,
                ref int lReg);
            //HI_PUTREGASCIIZ Not Used
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_READPRIMES(
                ref int lPrimesToRead);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REC_ADDFIELD(
                ref int Fld,
                ref int Rec);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REC_GETFIELD(
                ref int Rec,
                ref int Index,
                ref int Fld);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REC_GETNRFIELDS(
                ref int Rec);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGALLOCATE();
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGALLOCATERANGE(
                ref int lFirstReg,
                ref int lLastReg);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGCHANGEENDIAN(
                ref int lReg1,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGCLEAR(
                ref int lReg);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGCONCATBYTE(
                ref int lReg,
                ref int lVal);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGCONCATREG(
                ref int lReg1,
                ref int lReg2,
                ref int lReg3);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGGETLEN(
                ref int lReg);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGISTER(
                ref int lReg1);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGMAXALLOCATED();
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGREVERSE(
                ref int lReg1,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGSPLIT(
                ref int lRegIn,
                ref int lBytes,
                ref int lRegL,
                ref int lRegR);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGUNALLOCATE(
                ref int lReg);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGUNALLOCATERANGE(
                ref int lFirstReg,
                ref int lLastReg);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_REGWIPE(
                ref int lReg,
                ref int Mode,
                ref int Clr);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_SETOPTION(
                ref int lOption,
                ref int lParam);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_STACKWIPE(
                ref int StackSize,
                ref int Clearance);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_SUB(
                ref int lReg1,
                ref int lReg2,
                ref int lReg_Result);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_SWAPREG(
                ref int lReg1,
                ref int lReg2);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_TRIMLZEROES(
                ref int lRegIn,
                ref int lRegOut);
            [DllImport("HIME.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int HI_VERSION();
        #endregion

        #region HIME public exposed methods
            public static int hi_Add(int Reg1, int Reg2, int Reg_Result)
            {
                return HI_ADD(ref Reg1, ref Reg2, ref Reg_Result);
            }
            public static int hi_Base642Huge(int RegIn, int RegOut)
            {
                return HI_BASE642HUGE(ref RegIn, ref RegOut);
            }
            public static int hi_Bin2Huge(int RegIn, int RegOut)
            {
                return HI_BIN2HUGE(ref RegIn, ref RegOut);
            }
            public static int hi_BreakString(int RegIn, int CharsInChunk, int NrOfSpaces, int ChunksInLine, int Reg_Result)
            {
                return HI_BREAKSTRING(ref RegIn, ref CharsInChunk, ref NrOfSpaces, ref ChunksInLine, ref Reg_Result);
            }
            public static int hi_CheckTestVectors_Aes()
            {
                return HI_CHECKTESTVECTORS_AES();
            }
            public static int hi_CheckTestVectors_Arc4()
            {
                return HI_CHECKTESTVECTORS_ARC4();
            }
            public static int hi_CheckTestVectors_Md5()
            {
                return HI_CHECKTESTVECTORS_MD5();
            }
            public static int hi_CheckTestVectors_Sha_1()
            {
                return HI_CHECKTESTVECTORS_SHA_1();
            }
            public static int hi_CheckTestVectors_Sha_256()
            {
                return HI_CHECKTESTVECTORS_SHA_256();
            }
            public static int hi_CopyReg(int RegSource, int RegTarget)
            {
                return HI_COPYREG(ref RegSource, ref RegTarget);
            }
            public static int hi_Dec2Huge(int RegIn, int RegOut)
            {
                return HI_DEC2HUGE(ref RegIn, ref RegOut);
            }
            public static int hi_Decr(int Reg, int Reg_Result)
            {
                return HI_DECR(ref Reg, ref Reg_Result);
            }
            public static int hi_Decrypt_Aes_1Block(int Reg_Cipher, int Reg_Key, int Reg_Plain)
            {
                return HI_DECRYPT_AES_1BLOCK(ref Reg_Cipher, ref Reg_Key, ref Reg_Plain);
            }
            public static int hi_Decrypt_Aes_Cbc(int Reg_Cipher, int Reg_Key, int Reg_Plain)
            {
                return HI_DECRYPT_AES_CBC(ref Reg_Cipher, ref Reg_Key, ref Reg_Plain);
            }
            public static int hi_Decrypt_Aes_Ecb(int Reg_Cipher, int Reg_Key, int Reg_Plain)
            {
                return HI_DECRYPT_AES_ECB(ref Reg_Cipher, ref Reg_Key, ref Reg_Plain);
            }
            public static int hi_Decrypt_Arc4(int Reg_Cipher, int Reg_Key, int Reg_Plain, int BytesToDiscard)
            {
                return HI_DECRYPT_ARC4(ref Reg_Cipher, ref Reg_Key, ref Reg_Plain, ref BytesToDiscard);
            }
            public static int hi_Decrypt_Rsa(int Reg_Cipher, int Reg_hd, int Reg_hModul, int Reg_Plain)
            {
                return HI_DECRYPT_RSA(ref Reg_Cipher, ref Reg_hd, ref Reg_hModul, ref Reg_Plain);
            }
            public static int hi_Dh_GenParams(int BitLength, int RegP, int RegG)
            {
                return HI_DH_GENPARAMS(ref BitLength, ref RegP, ref RegG);
            }
            public static int hi_Dh_Step1(int RegP, int RegG, int Priv, int lPub)
            {
                return HI_DH_STEP1(ref RegP, ref RegG, ref Priv, ref lPub);
            }
            public static int hi_Dh_Step2(int RegP, int lPub, int Priv, int Shared)
            {
                return HI_DH_STEP2(ref RegP, ref lPub, ref Priv, ref Shared);
            }
            public static int hi_Div(int Reg1, int Reg2, int Reg_Quot, int Reg_Rem)
            {
                return HI_DIV(ref Reg1, ref Reg2, ref Reg_Quot, ref Reg_Rem);
            }
            public static int hi_DivBy2(int Reg, int Reg_Quot, int Reg_Rem)
            {
                return HI_DIVBY2(ref Reg, ref Reg_Quot, ref Reg_Rem);
            }
            public static int hi_Encrypt_Aes_1Block(int Reg_Plain, int Reg_Key, int Reg_Cipher)
            {
                return HI_ENCRYPT_AES_1BLOCK(ref Reg_Plain, ref Reg_Key, ref Reg_Cipher);
            }
            public static int hi_Encrypt_Aes_Cbc(int Reg_Plain, int Reg_Key, int Reg_IV, int Reg_Cipher)
            {
                return HI_ENCRYPT_AES_CBC(ref Reg_Plain, ref Reg_Key, ref Reg_IV, ref Reg_Cipher);
            }
            public static int hi_Encrypt_Aes_Ecb(int Reg_Plain, int Reg_Key, int Reg_Cipher)
            {
                return HI_ENCRYPT_AES_ECB(ref Reg_Plain, ref Reg_Key, ref Reg_Cipher);
            }
            public static int hi_Encrypt_Arc4(int Reg_Plain, int Reg_Key, int Reg_Cipher, int BytesToDiscard)
            {
                return HI_ENCRYPT_ARC4(ref Reg_Plain, ref Reg_Key, ref Reg_Cipher, ref BytesToDiscard);
            }
            public static int hi_Encrypt_Rsa(int Reg_Plain, int Reg_he, int Reg_hModul, int Reg_Cipher)
            {
                return HI_ENCRYPT_RSA(ref Reg_Plain, ref Reg_he, ref Reg_hModul, ref Reg_Cipher);
            }
            public static int hi_Gcd(int Reg1, int Reg2, int Reg_Result)
            {
                return HI_GCD(ref Reg1, ref Reg2, ref Reg_Result);
            }
            public static int hi_GenerateBbsRandomBits(int Bytes, int MultipleBits, int Reg_SSeed, int Reg_Modul, int Reg_Result, int Reg_ESeed)
            {
                return HI_GENERATEBBSRANDOMBITS(ref Bytes, ref MultipleBits, ref Reg_SSeed, ref Reg_Modul, ref Reg_Result, ref Reg_ESeed);
            }
            public static int hi_GeneratePrime(int LengthBits, int PrimeTests, int Reg_Result)
            {
                return HI_GENERATEPRIME(ref LengthBits, ref PrimeTests, ref Reg_Result);
            }
            public static int hi_GenerateRandom(int LengthBits, int Reg_Result)
            {
                return HI_GENERATERANDOM(ref LengthBits, ref Reg_Result);
            }
            public static int hi_GenerateRsaKeys(int BitLength, int PrimeTests, int Reg_he, int Reg_hd, int Reg_Modul)
            {
                return HI_GENERATERSAKEYS(ref BitLength, ref PrimeTests, ref Reg_he, ref Reg_hd, ref Reg_Modul);
            }
            public static int hi_GenerateRsaRandombits(int Bytes, int Reg_SSeed, int Reg_he, int Reg_Modul, int Reg_Result, int Reg_EndSeed)
            {
                return HI_GENERATERSARANDOMBITS(ref Bytes, ref Reg_SSeed, ref Reg_he, ref Reg_Modul, ref Reg_Result, ref Reg_EndSeed);
            }
            public static int hi_GetGlobalError()
            {
                return HI_GETGLOBALERROR();
            }
            public static int hi_GetOption(int Option, int Param)
            {
                return HI_GETOPTION(ref Option, ref Param);
            }
            public static StringBuilder hi_GetReg(int Reg)
            {
                int Len = hi_RegGetLen(Reg);
                StringBuilder lAddress = new StringBuilder(Len);
                int ret = HI_GETREGADD(ref Reg, ref lAddress, ref Len);
                return lAddress;
            }
            public static int hi_GetRegByte(int Reg, int index)
            {
                return HI_GETREGBYTE(ref Reg, ref index);
            }
            public static int hi_Hash_Crc32(int RegIn, int RegOut)
            {
                return HI_HASH_CRC32(ref RegIn, ref RegOut);
            }
            public static int hi_Hash_Md5(int RegIn, int RegOut)
            {
                return HI_HASH_MD5(ref RegIn, ref RegOut);
            }
            public static int hi_Hash_Sha_1(int RegIn, int RegOut)
            {
                return HI_HASH_SHA_1(ref RegIn, ref RegOut);
            }
            public static int hi_Hash_Sha_256(int RegIn, int RegOut)
            {
                return HI_HASH_SHA_256(ref RegIn, ref RegOut);
            }
            public static int hi_Hex2Huge(int RegIn, int RegOut)
            {
                return HI_HEX2HUGE(ref RegIn, ref RegOut);
            }
            public static int hi_Huge2Base64(int RegIn, int RegOut)
            {
                return HI_HUGE2BASE64(ref RegIn, ref RegOut);
            }
            public static int hi_Huge2Bin(int RegIn, int RegOut)
            {
                return HI_HUGE2BIN(ref RegIn, ref RegOut);
            }
            public static int hi_Huge2Dec(int RegIn, int RegOut)
            {
                return HI_HUGE2DEC(ref RegIn, ref RegOut);
            }
            public static int hi_Huge2Hex(int RegIn, int RegOut)
            {
                return HI_HUGE2HEX(ref RegIn, ref RegOut);
            }
            public static int hi_Incr(int Reg, int Reg_Result)
            {
                return HI_INCR(ref Reg, ref Reg_Result);
            }
            public static int hi_InitBbs(int BitLength, int PrimeTests, int Reg_Modul, int Reg_Seed)
            {
                return HI_INITBBS(ref BitLength, ref PrimeTests, ref Reg_Modul, ref Reg_Seed);
            }
            public static int hi_IsEqual(int Reg1, int Reg2)
            {
                return HI_ISEQUAL(ref Reg1, ref Reg2);
            }
            public static int hi_IsLess(int Reg1, int Reg2)
            {
                return HI_ISLESS(ref Reg1, ref Reg2);
            }
            public static int hi_IsNotEqual(int Reg1, int Reg2)
            {
                return HI_ISNOTEQUAL(ref Reg1, ref Reg2);
            }
            public static int hi_IsOdd(int Reg)
            {
                return HI_ISODD(ref Reg);
            }
            public static int hi_IsPrime_Div(int Reg)
            {
                return HI_ISPRIME_DIV(ref Reg);
            }
            public static int hi_IsPrime_F(int Tests, int Reg)
            {
                return HI_ISPRIME_F(ref Tests, ref Reg);
            }
            public static int hi_IsPrime_Rb(int Tests, int Reg)
            {
                return HI_ISPRIME_RB(ref Tests, ref Reg);
            }
            public static int hi_IsPrime_Slow(int Reg)
            {
                return HI_ISPRIME_SLOW(ref Reg);
            }
            public static int hi_IsRegAllocated(int Reg)
            {
                return HI_ISREGALLOCATED(ref Reg);
            }
            public static int hi_IsRelprime(int Reg1, int Reg2)
            {
                return HI_ISRELPRIME(ref Reg1, ref Reg2);
            }
            public static int hi_IsZero(int Reg)
            {
                return HI_ISZERO(ref Reg);
            }
            public static int hi_Mod(int Reg1, int Reg2, int Reg_Result)
            {
                return HI_MOD(ref Reg1, ref Reg2, ref Reg_Result);
            }
            public static int hi_Modinv(int Reg1, int Reg2, int Reg_Result)
            {
                return HI_MODINV(ref Reg1, ref Reg2, ref Reg_Result);
            }
            public static int hi_Mul(int Reg1, int Reg2, int Reg_Result)
            {
                return HI_MUL(ref Reg1, ref Reg2, ref Reg_Result);
            }
            public static int hi_MulBy2(int Reg1, int Reg_Result)
            {
                return HI_MULBY2(ref Reg1, ref Reg_Result);
            }
            public static int hi_Pow(int Reg1, int Reg2, int Reg_Result)
            {
                return HI_POW(ref Reg1, ref Reg2, ref Reg_Result);
            }
            public static int hi_PowMod(int Reg1, int Reg2, int Reg3, int Reg_Result)
            {
                return HI_POWMOD(ref Reg1, ref Reg2, ref Reg3, ref Reg_Result);
            }
            public static int hi_PutReg(string h, int Reg)
            {
                int Len = h.Length;
                return HI_PUTREGADD(ref h, ref Len, ref Reg);
            }
            public static int hi_ReadPrimes(int PrimesToRead)
            {
                return HI_READPRIMES(ref PrimesToRead);
            }
            public static int hi_Rec_AddField(int Fld, int Rec)
            {
                return HI_REC_ADDFIELD(ref Fld, ref Rec);
            }
            public static int hi_Rec_GetField(int Rec, int Index, int Fld)
            {
                return HI_REC_GETFIELD(ref Rec, ref Index, ref Fld);
            }
            public static int hi_Rec_GetNrFields(int Rec)
            {
                return HI_REC_GETNRFIELDS(ref Rec);
            }
            public static int hi_RegAllocate()
            {
                return HI_REGALLOCATE();
            }
            public static int hi_RegAllocateRange(int FirstReg, int LastReg)
            {
                return HI_REGALLOCATERANGE(ref FirstReg, ref LastReg);
            }
            public static int hi_RegChangeEndian(int Reg, int Reg_Result)
            {
                return HI_REGCHANGEENDIAN(ref Reg, ref Reg_Result);
            }
            public static int hi_RegClear(int Reg)
            {
                return HI_REGCLEAR(ref Reg);
            }
            public static int hi_RegConcatByte(int Reg, int Val)
            {
                return HI_REGCONCATBYTE(ref Reg, ref Val);
            }
            public static int hi_RegConcatReg(int Reg1, int Reg2, int Reg3)
            {
                return HI_REGCONCATREG(ref Reg1, ref Reg2, ref Reg3);
            }
            public static int hi_RegGetLen(int Reg)
            {
                return HI_REGGETLEN(ref Reg);
            }
            public static int hi_Register(int Reg)
            {
                return HI_REGISTER(ref Reg);
            }
            public static int hi_RegMaxAllocated()
            {
                return HI_REGMAXALLOCATED();
            }
            public static int hi_RegReverse(int Reg, int Reg_Result)
            {
                return HI_REGREVERSE(ref Reg, ref Reg_Result);
            }
            public static int hi_RegSplit(int RegIn, int Bytes, int RegL, int RegR)
            {
                return HI_REGSPLIT(ref RegIn, ref Bytes, ref RegL, ref RegR);
            }
            public static int hi_RegUnallocate(int Reg)
            {
                return HI_REGUNALLOCATE(ref Reg);
            }
            public static int hi_RegUnallocateRange(int FirstReg, int LastReg)
            {
                return HI_REGUNALLOCATERANGE(ref FirstReg, ref LastReg);
            }
            public static int hi_RegWipe(int Reg, int Mode, int Clr)
            {
                return HI_REGWIPE(ref Reg, ref Mode, ref Clr);
            }
            public static int hi_SetOption(int Option, int Param)
            {
                return HI_SETOPTION(ref Option, ref Param);
            }
            public static int hi_StackWipe(int StackSize, int Clearance)
            {
                return HI_STACKWIPE(ref StackSize, ref Clearance);
            }
            public static int hi_Sub(int Reg1, int Reg2, int Reg_Result)
            {
                return HI_SUB(ref Reg1, ref Reg2, ref Reg_Result);
            }
            public static int hi_SwapReg(int Reg1, int Reg2)
            {
                return HI_SWAPREG(ref Reg1, ref Reg2);
            }
            public static int hi_TrimLZeroes(int RegIn, int RegOut)
            {
                return HI_TRIMLZEROES(ref RegIn, ref RegOut);
            }
            public static int hi_Version()
            {
                return HI_VERSION();
            }
        #endregion
    }

}