Announcement

Collapse
No announcement yet.

AES encryption

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AES encryption

    It will be a long file is encrypted with AES. Original Code:
    http://www.powerbasic.com/support/pb...ad.php?t=39932

    Do I have to pass again and again the same password to the encrypt_buffer()?
    Within the encrypt_buffer() will always the function Set_Key() called. This costs performance.

    Code:
    [B]' aes.bas (PB9)[/B]
    #COMPILE EXE
    #DIM ALL
    #INCLUDE "aes.inc"
    
    %BUFFER_LEN = 100000
    
    FUNCTION PBMAIN () AS LONG
    LOCAL password$, plain$
    LOCAL remainder AS LONG
        password$=LSET$("super secret password",32)
        OPEN "C:\Temp\testfile.txt" FOR BINARY ACCESS READ AS #1
        OPEN "C:\Temp\testfile.crypt" FOR BINARY ACCESS WRITE AS #2
            remainder = LOF(#1)
            WHILE remainder > 0
                IF ( remainder ) > %BUFFER_LEN THEN
                    GET$ #1, %BUFFER_LEN, plain$
                    remainder = remainder - %BUFFER_LEN
                ELSE
                    GET$ #1, remainder, plain$
                    remainder = 0
                END IF
                CALL [B]encrypt_buffer[/B]([B]password$[/B],STRPTR(plain$),LEN(plain$))
                PUT$ #2, plain$
            WEND
        CLOSE
    END FUNCTION
    Code:
    [B]' aes.inc (PB9)[/B]
    '-- Rem this equate for any use other than verification of implementation.
    %VERIFY_IMPLEMENTATION = 1
    
    %MAX_ROUNDS = 14
    %MIN_ROUNDS = 10
    %BLOCKSIZE = 16
    %SUBKEY_SIZE = (%BLOCKSIZE*2*8) '256
    
    TYPE ENCRYPTION_CONTEXT
      Action AS LONG
      Rounds AS LONG
      UserKeyLength AS LONG
      UserKey AS LONG PTR
      InBlock AS LONG PTR
      OutBlock AS LONG PTR
      KeyBlocks AS LONG                  '4*4-byte blocks
      KE AS LONG PTR                     '<-- pointer to encryption subkey buffer
      KE_Buffer AS STRING * %SUBKEY_SIZE '<-- encryption subkey buffer
      KD AS LONG PTR                     '<-- pointer to decryption subkey buffer
      KD_Buffer AS STRING * %SUBKEY_SIZE '<-- decryption subkey buffer
      Se AS BYTE PTR
      Sd AS BYTE PTR
      Te0 AS LONG PTR
      Te1 AS LONG PTR
      Te2 AS LONG PTR
      Te3 AS LONG PTR
      Td0 AS LONG PTR
      Td1 AS LONG PTR
      Td2 AS LONG PTR
      Td3 AS LONG PTR
      Rcon AS LONG PTR
    END TYPE
    
    
    '--------------------
    MACRO FUNCTION shiftlc(xx,constant_shiftval)
      retval = (xx)
      ! shl retval, constant_shiftval
    END MACRO = retval
    
    '--------------------
    MACRO FUNCTION shiftrc(xx,constant_shiftval)
      retval = (xx)
      ! shr retval, constant_shiftval
    END MACRO = retval
    
    '--------------------
    MACRO FUNCTION byte3(xx)
      retval = (xx)
      ! mov eax, retval
      ! shr eax, 24
      ! mov retval, eax
    END MACRO = retval
    
    '--------------------
    MACRO FUNCTION byte2(xx)
      retval = (xx)
      ! mov eax, retval
      ! shr eax, 16
      ! and eax, &hff
      ! mov retval, eax
    END MACRO = retval
    
    '--------------------
    MACRO FUNCTION byte1(xx)
      retval = (xx)
      ! mov eax, retval
      ! shr eax, 8
      ! and eax, &hff
      ! mov retval, eax
    END MACRO = retval
    
    '--------------------
    MACRO FUNCTION byte0(xx)
      retval = (xx)
      ! mov eax, retval
      ! and eax, &hff
      ! mov retval, eax
    END MACRO = retval
    
    '--------------------
    MACRO FUNCTION get_block(mem_ptr)
      ! mov edx, mem_ptr
      ! mov eax, [edx]
      #IF %DEF(%VERIFY_IMPLEMENTATION)
         ! bswap eax
      #ENDIF
      ! mov retval, eax
      ! add edx, 4
      ! mov mem_ptr, edx
    END MACRO = retval
    
    '--------------------
    MACRO put_block(mem_ptr,value)
      retval=value
      ! mov edx, retval
      #IF %DEF(%VERIFY_IMPLEMENTATION)
         ! bswap edx
      #ENDIF
      ! mov eax, mem_ptr
      ! mov [eax], edx
      ! add eax, 4
      ! mov mem_ptr, eax
    END MACRO
    
    '--------------------
    MACRO FUNCTION imix(tt)
      u = [email protected][[email protected][byte3(tt)]]
      u = u XOR [email protected][[email protected][byte2(tt)]]
      u = u XOR [email protected][[email protected][byte1(tt)]]
      u = u XOR [email protected][[email protected][tt AND &hff]]
    END MACRO = u
    
    '--------------------
    MACRO FUNCTION packbytes(aa,bb,cc,dd)
      aa = shiftlc(aa,24)
      bb = shiftlc(bb,16)
      cc = shiftlc(cc,8)
    END MACRO = (aa OR bb OR cc OR dd)
    
    '--------------------
    MACRO FUNCTION enc_ta(aa,bb,cc,dd)
      u = [email protected][byte3(aa)]
      u = u XOR [email protected][byte2(bb)]
      u = u XOR [email protected][byte1(cc)]
      u = u XOR [email protected][dd AND &hff]
    END MACRO = u
    
    '--------------------
    MACRO FUNCTION enc_tal(aa,bb,cc,dd,ww)
      u = [email protected][byte3(aa)]
      v = shiftrc(ww,24)
      a0 = u XOR v
      u = [email protected][byte2(bb)]
      v = shiftrc(ww,16)
      a1 = (u XOR v) AND &hff
      u = [email protected][byte1(cc)]
      v = shiftrc(ww,8)
      a2 = (u XOR v) AND &hff
      u = [email protected][dd AND &hff]
      v = ww
      a3 = (u XOR v) AND &hff
      retval = packbytes(a0,a1,a2,a3)
    END MACRO = retval
    
    '--------------------
    MACRO FUNCTION dec_ta(aa,bb,cc,dd)
      u = [email protected][byte3(aa)]
      u = u XOR [email protected][byte2(bb)]
      u = u XOR [email protected][byte1(cc)]
      u = u XOR [email protected][dd AND &hff]
    END MACRO = u
    
    '--------------------
    MACRO FUNCTION dec_tal(aa,bb,cc,dd,ww)
      u = [email protected][byte3(aa)]
      v = shiftrc(ww,24)
      a0 = u XOR v
      u = [email protected][byte2(bb)]
      v = shiftrc(ww,16)
      a1 = (u XOR v) AND &hff
      u = [email protected][byte1(cc)]
      v = shiftrc(ww,8)
      a2 = (u XOR v) AND &hff
      u = [email protected][dd AND &hff]
      v = ww
      a3 = (u XOR v) AND &hff
      retval = packbytes(a0,a1,a2,a3)
    END MACRO = retval
    
    
    FUNCTION Set_Key(Ctx AS ENCRYPTION_CONTEXT) AS LONG
      LOCAL i&, n&, nk&, pblock&, r&, temp&, t&, u&, v&, retval&
      LOCAL in_ukey$, in_key AS LONG PTR, k AS LONG PTR, s AS BYTE PTR
      LOCAL d&, e&
    
      SELECT CASE AS LONG Ctx.UserKeyLength
      CASE 16
        Ctx.Rounds = 10
      CASE 24
        Ctx.Rounds = 12
      CASE 32
        Ctx.Rounds = 14
      CASE ELSE
        FUNCTION = 0
        EXIT FUNCTION
      END SELECT
      Ctx.KeyBlocks = (Ctx.Rounds+1)*4
      CALL Rijndael_Init(Ctx)
      in_ukey$=STRING$(%BLOCKSIZE*2,0)
    
      in_key = STRPTR(in_ukey$)
      pblock = Ctx.UserKey
    
      k = Ctx.KE 'local copy
      FOR i = 0 TO (Ctx.Rounds-6)-1
        @k[i] = get_block(pblock)
      NEXT i
      s = Ctx.Se
      i = Ctx.Rounds - 6
      nk = i
      n = 0
      DO WHILE i < Ctx.KeyBlocks
        temp = @k[i-1]
        IF n = 0 THEN
          n = Nk
          t = byte2(temp)
          v = shiftlc(@s[t],24)
          t = byte1(temp)
          u = shiftlc(@s[t],16)
          v = v OR u
          t = byte0(temp)
          u = shiftlc(@s[t],8)
          v = v OR u
          u = @s[byte3(temp)]
          temp = (v OR u) XOR [email protected][r]
          INCR r
        ELSE
          IF ((Nk = 8) AND (n = 4)) THEN
            t = byte3(temp)
            v = shiftlc(@s[t],24)
            t = byte2(temp)
            u = shiftlc(@s[t],16)
            v = v OR u
            t = byte1(temp)
            u = shiftlc(@s[t],8)
            v = v OR u
            u = @s[temp AND &hff]
            temp = v OR u
          END IF
        END IF
        @k[i] = @k[i-nk] XOR temp
        INCR i
        DECR n
      LOOP
    
      IF Ctx.Action = 2 THEN  'decrypt
        'MakeDecryptKeySchedule Ctx
        k = Ctx.KD
        d = 0
        e = Ctx.Rounds*4
        @k[d] = [email protected][e]
        @k[d+1] = [email protected][e+1]
        @k[d+2] = [email protected][e+2]
        @k[d+3] = [email protected][e+3]
        d = d + 4
        e = e - 4
        FOR i = 1 TO Ctx.Rounds-1
          t = [email protected][e]
          @k[d] = imix(t)
          t = [email protected][e+1]
          @k[d+1] = imix(t)
          t = [email protected][e+2]
          @k[d+2] = imix(t)
          t = [email protected][e+3]
          @k[d+3] = imix(t)
          d = d + 4
          e = e - 4
        NEXT i
        @k[d] = [email protected][e]
        @k[d+1] = [email protected][e+1]
        @k[d+2] = [email protected][e+2]
        @k[d+3] = [email protected][e+3]
      END IF
      FUNCTION = -1
    END FUNCTION
    
    
    '====================
    SUB encrypt_buffer(password$, src_buffer AS DWORD, src_size AS DWORD)
      REGISTER i&
      LOCAL r&, t&, u&, v&, w&, pblock&, retval&, k AS LONG PTR
      LOCAL a0&, a1&, a2&, a3&, t0&, t1&, t2&, t3&, s0&, s1&, s2&, s3&
      LOCAL ctx AS ENCRYPTION_CONTEXT
      LOCAL key AS STRING
    
      ctx.action        = 1  'ENCRYPT
      ctx.UserKey       = STRPTR(password$)
      ctx.UserKeyLength = LEN(password$)    '32 'key_size
      ctx.InBlock       = src_buffer
    
      IF Set_Key(ctx) THEN
        FOR i = 1 TO (src_size \ %BLOCKSIZE)  '<-- Required: (len(plain$) mod 16) = 0
          pblock = Ctx.InBlock
          t0 = get_block(pblock)
          t1 = get_block(pblock)
          t2 = get_block(pblock)
          t3 = get_block(pblock)
          k = Ctx.KE
          t0 = t0 XOR @k[0]
          t1 = t1 XOR @k[1]
          t2 = t2 XOR @k[2]
          t3 = t3 XOR @k[3]
          FOR r = 1 TO Ctx.Rounds-1
            k = k + (4*4)
            t = enc_ta(t0,t1,t2,t3)
            a0 = t XOR @k[0]
            t = enc_ta(t1,t2,t3,t0)
            a1 = t XOR @k[1]
            t = enc_ta(t2,t3,t0,t1)
            a2 = t XOR @k[2]
            t = enc_ta(t3,t0,t1,t2)
            a3 = t XOR @k[3]
            t0 = a0
            t1 = a1
            t2 = a2
            t3 = a3
          NEXT r
          k = k + (4*4)
          w = @k[0]
          s0 = enc_tal(t0,t1,t2,t3,w)
          w = @k[1]
          s1 = enc_tal(t1,t2,t3,t0,w)
          w = @k[2]
          s2 = enc_tal(t2,t3,t0,t1,w)
          w = @k[3]
          s3 = enc_tal(t3,t0,t1,t2,w)
    
          pblock = Ctx.InBlock     'Ctx.OutBlock
          put_block(pblock,s0)
          put_block(pblock,s1)
          put_block(pblock,s2)
          put_block(pblock,s3)
    
          ctx.InBlock  = ctx.InBlock  + %BLOCKSIZE
        NEXT i&
      ELSE
         MSGBOX "DoEncrypt SetKey Error"
      END IF
    
      '-- Burn the subkey
      IF Ctx.KE THEN
        POKE$ Ctx.KE, STRING$(SIZEOF(Ctx.KE_Buffer),0)
      END IF
      IF Ctx.KD THEN
        POKE$ Ctx.KD, STRING$(SIZEOF(Ctx.KD_Buffer),0)
      END IF
    
    
    END SUB
    
    
    '====================
    SUB decrypt_buffer(password$,src_buffer AS DWORD,src_size AS DWORD)
      REGISTER i&
      LOCAL r&, t&, u&, v&, w&, pblock&, retval&, k AS LONG PTR
      LOCAL a0&, a1&, a2&, a3&, t0&, t1&, t2&, t3&, s0&, s1&, s2&, s3&
      LOCAL ctx AS ENCRYPTION_CONTEXT
      LOCAL key AS STRING
    
      ctx.action        = 2  'DECRYPT
      ctx.UserKey       = STRPTR(password$)
      ctx.UserKeyLength = LEN(password$)
      ctx.InBlock       = src_buffer
    
      IF Set_Key&(ctx) THEN
        FOR i = 1 TO (src_size\%BLOCKSIZE)
          pblock = Ctx.InBlock
          t0 = get_block(pblock)
          t1 = get_block(pblock)
          t2 = get_block(pblock)
          t3 = get_block(pblock)
          k = Ctx.KD
          t0 = t0 XOR @k[0]
          t1 = t1 XOR @k[1]
          t2 = t2 XOR @k[2]
          t3 = t3 XOR @k[3]
          FOR r = 1 TO Ctx.Rounds-1
            k = k + (4*4)
            t = dec_ta(t0,t3,t2,t1)
            a0 = t XOR @k[0]
            t = dec_ta(t1,t0,t3,t2)
            a1 = t XOR @k[1]
            t = dec_ta(t2,t1,t0,t3)
            a2 = t XOR @k[2]
            t = dec_ta(t3,t2,t1,t0)
            a3 = t XOR @k[3]
            t0 = a0
            t1 = a1
            t2 = a2
            t3 = a3
          NEXT r
          k = k + (4*4)
          w = @k[0]
          s0 = dec_tal(t0,t3,t2,t1,w)
          w = @k[1]
          s1 = dec_tal(t1,t0,t3,t2,w)
          w = @k[2]
          s2 = dec_tal(t2,t1,t0,t3,w)
          w = @k[3]
          s3 = dec_tal(t3,t2,t1,t0,w)
    
          pblock = Ctx.InBlock        'Ctx.OutBlock
          put_block(pblock,s0)
          put_block(pblock,s1)
          put_block(pblock,s2)
          put_block(pblock,s3)
    
          ctx.InBlock  = ctx.InBlock  + %BLOCKSIZE
    
        NEXT i
      ELSE
         MSGBOX "DoDecrypt SetKey Error"
      END IF
    
      '-- Burn the subkey
      IF Ctx.KE THEN
        POKE$ Ctx.KE, STRING$(SIZEOF(Ctx.KE_Buffer),0)
      END IF
      IF Ctx.KD THEN
        POKE$ Ctx.KD, STRING$(SIZEOF(Ctx.KD_Buffer),0)
      END IF
    
    
    END SUB
    
    '====================
    SUB Rijndael_Init(Ctx AS ENCRYPTION_CONTEXT)
      LOCAL te0&
      Ctx.KE_Buffer = STRING$(%SUBKEY_SIZE,0)
      Ctx.KE = VARPTR(Ctx.KE_Buffer)
      Ctx.KD_Buffer =STRING$(%SUBKEY_SIZE,0)
      Ctx.KD = VARPTR(Ctx.KD_Buffer)
      te0 = CODEPTR(Table_Data)
      Ctx.Te0 = te0
      Ctx.Te1 = te0+(1024)
      Ctx.Te2 = te0+(1024*2)
      Ctx.Te3 = te0+(1024*3)
      Ctx.Td0 = te0+(1024*4)
      Ctx.Td1 = te0+(1024*5)
      Ctx.Td2 = te0+(1024*6)
      Ctx.Td3 = te0+(1024*7)
      Ctx.Se = te0+(1024*8)
      Ctx.Sd = Ctx.Se+(256)
      Ctx.Rcon = Ctx.Se+(256*2)
    
      EXIT SUB
    
      '============
      Table_Data:
      ! DB &hA5,&h63,&h63,&hC6,&h84,&h7C,&h7C,&hF8,&h99,&h77,&h77,&hEE,&h8D,&h7B,&h7B,&hF6
      ! DB &h0D,&hF2,&hF2,&hFF,&hBD,&h6B,&h6B,&hD6,&hB1,&h6F,&h6F,&hDE,&h54,&hC5,&hC5,&h91
      ! DB &h50,&h30,&h30,&h60,&h03,&h01,&h01,&h02,&hA9,&h67,&h67,&hCE,&h7D,&h2B,&h2B,&h56
      ! DB &h19,&hFE,&hFE,&hE7,&h62,&hD7,&hD7,&hB5,&hE6,&hAB,&hAB,&h4D,&h9A,&h76,&h76,&hEC
      ! DB &h45,&hCA,&hCA,&h8F,&h9D,&h82,&h82,&h1F,&h40,&hC9,&hC9,&h89,&h87,&h7D,&h7D,&hFA
      ! DB &h15,&hFA,&hFA,&hEF,&hEB,&h59,&h59,&hB2,&hC9,&h47,&h47,&h8E,&h0B,&hF0,&hF0,&hFB
      ! DB &hEC,&hAD,&hAD,&h41,&h67,&hD4,&hD4,&hB3,&hFD,&hA2,&hA2,&h5F,&hEA,&hAF,&hAF,&h45
      ! DB &hBF,&h9C,&h9C,&h23,&hF7,&hA4,&hA4,&h53,&h96,&h72,&h72,&hE4,&h5B,&hC0,&hC0,&h9B
      ! DB &hC2,&hB7,&hB7,&h75,&h1C,&hFD,&hFD,&hE1,&hAE,&h93,&h93,&h3D,&h6A,&h26,&h26,&h4C
      ! DB &h5A,&h36,&h36,&h6C,&h41,&h3F,&h3F,&h7E,&h02,&hF7,&hF7,&hF5,&h4F,&hCC,&hCC,&h83
      ! DB &h5C,&h34,&h34,&h68,&hF4,&hA5,&hA5,&h51,&h34,&hE5,&hE5,&hD1,&h08,&hF1,&hF1,&hF9
      ! DB &h93,&h71,&h71,&hE2,&h73,&hD8,&hD8,&hAB,&h53,&h31,&h31,&h62,&h3F,&h15,&h15,&h2A
      ! DB &h0C,&h04,&h04,&h08,&h52,&hC7,&hC7,&h95,&h65,&h23,&h23,&h46,&h5E,&hC3,&hC3,&h9D
      ! DB &h28,&h18,&h18,&h30,&hA1,&h96,&h96,&h37,&h0F,&h05,&h05,&h0A,&hB5,&h9A,&h9A,&h2F
      ! DB &h09,&h07,&h07,&h0E,&h36,&h12,&h12,&h24,&h9B,&h80,&h80,&h1B,&h3D,&hE2,&hE2,&hDF
      ! DB &h26,&hEB,&hEB,&hCD,&h69,&h27,&h27,&h4E,&hCD,&hB2,&hB2,&h7F,&h9F,&h75,&h75,&hEA
      ! DB &h1B,&h09,&h09,&h12,&h9E,&h83,&h83,&h1D,&h74,&h2C,&h2C,&h58,&h2E,&h1A,&h1A,&h34
      ! DB &h2D,&h1B,&h1B,&h36,&hB2,&h6E,&h6E,&hDC,&hEE,&h5A,&h5A,&hB4,&hFB,&hA0,&hA0,&h5B
      ! DB &hF6,&h52,&h52,&hA4,&h4D,&h3B,&h3B,&h76,&h61,&hD6,&hD6,&hB7,&hCE,&hB3,&hB3,&h7D
      ! DB &h7B,&h29,&h29,&h52,&h3E,&hE3,&hE3,&hDD,&h71,&h2F,&h2F,&h5E,&h97,&h84,&h84,&h13
      ! DB &hF5,&h53,&h53,&hA6,&h68,&hD1,&hD1,&hB9,&h00,&h00,&h00,&h00,&h2C,&hED,&hED,&hC1
      ! DB &h60,&h20,&h20,&h40,&h1F,&hFC,&hFC,&hE3,&hC8,&hB1,&hB1,&h79,&hED,&h5B,&h5B,&hB6
      ! DB &hBE,&h6A,&h6A,&hD4,&h46,&hCB,&hCB,&h8D,&hD9,&hBE,&hBE,&h67,&h4B,&h39,&h39,&h72
      ! DB &hDE,&h4A,&h4A,&h94,&hD4,&h4C,&h4C,&h98,&hE8,&h58,&h58,&hB0,&h4A,&hCF,&hCF,&h85
      ! DB &h6B,&hD0,&hD0,&hBB,&h2A,&hEF,&hEF,&hC5,&hE5,&hAA,&hAA,&h4F,&h16,&hFB,&hFB,&hED
      ! DB &hC5,&h43,&h43,&h86,&hD7,&h4D,&h4D,&h9A,&h55,&h33,&h33,&h66,&h94,&h85,&h85,&h11
      ! DB &hCF,&h45,&h45,&h8A,&h10,&hF9,&hF9,&hE9,&h06,&h02,&h02,&h04,&h81,&h7F,&h7F,&hFE
      ! DB &hF0,&h50,&h50,&hA0,&h44,&h3C,&h3C,&h78,&hBA,&h9F,&h9F,&h25,&hE3,&hA8,&hA8,&h4B
      ! DB &hF3,&h51,&h51,&hA2,&hFE,&hA3,&hA3,&h5D,&hC0,&h40,&h40,&h80,&h8A,&h8F,&h8F,&h05
      ! DB &hAD,&h92,&h92,&h3F,&hBC,&h9D,&h9D,&h21,&h48,&h38,&h38,&h70,&h04,&hF5,&hF5,&hF1
      ! DB &hDF,&hBC,&hBC,&h63,&hC1,&hB6,&hB6,&h77,&h75,&hDA,&hDA,&hAF,&h63,&h21,&h21,&h42
      ! DB &h30,&h10,&h10,&h20,&h1A,&hFF,&hFF,&hE5,&h0E,&hF3,&hF3,&hFD,&h6D,&hD2,&hD2,&hBF
      ! DB &h4C,&hCD,&hCD,&h81,&h14,&h0C,&h0C,&h18,&h35,&h13,&h13,&h26,&h2F,&hEC,&hEC,&hC3
      ! DB &hE1,&h5F,&h5F,&hBE,&hA2,&h97,&h97,&h35,&hCC,&h44,&h44,&h88,&h39,&h17,&h17,&h2E
      ! DB &h57,&hC4,&hC4,&h93,&hF2,&hA7,&hA7,&h55,&h82,&h7E,&h7E,&hFC,&h47,&h3D,&h3D,&h7A
      ! DB &hAC,&h64,&h64,&hC8,&hE7,&h5D,&h5D,&hBA,&h2B,&h19,&h19,&h32,&h95,&h73,&h73,&hE6
      ! DB &hA0,&h60,&h60,&hC0,&h98,&h81,&h81,&h19,&hD1,&h4F,&h4F,&h9E,&h7F,&hDC,&hDC,&hA3
      ! DB &h66,&h22,&h22,&h44,&h7E,&h2A,&h2A,&h54,&hAB,&h90,&h90,&h3B,&h83,&h88,&h88,&h0B
      ! DB &hCA,&h46,&h46,&h8C,&h29,&hEE,&hEE,&hC7,&hD3,&hB8,&hB8,&h6B,&h3C,&h14,&h14,&h28
      ! DB &h79,&hDE,&hDE,&hA7,&hE2,&h5E,&h5E,&hBC,&h1D,&h0B,&h0B,&h16,&h76,&hDB,&hDB,&hAD
      ! DB &h3B,&hE0,&hE0,&hDB,&h56,&h32,&h32,&h64,&h4E,&h3A,&h3A,&h74,&h1E,&h0A,&h0A,&h14
      ! DB &hDB,&h49,&h49,&h92,&h0A,&h06,&h06,&h0C,&h6C,&h24,&h24,&h48,&hE4,&h5C,&h5C,&hB8
      ! DB &h5D,&hC2,&hC2,&h9F,&h6E,&hD3,&hD3,&hBD,&hEF,&hAC,&hAC,&h43,&hA6,&h62,&h62,&hC4
      ! DB &hA8,&h91,&h91,&h39,&hA4,&h95,&h95,&h31,&h37,&hE4,&hE4,&hD3,&h8B,&h79,&h79,&hF2
      ! DB &h32,&hE7,&hE7,&hD5,&h43,&hC8,&hC8,&h8B,&h59,&h37,&h37,&h6E,&hB7,&h6D,&h6D,&hDA
      ! DB &h8C,&h8D,&h8D,&h01,&h64,&hD5,&hD5,&hB1,&hD2,&h4E,&h4E,&h9C,&hE0,&hA9,&hA9,&h49
      ! DB &hB4,&h6C,&h6C,&hD8,&hFA,&h56,&h56,&hAC,&h07,&hF4,&hF4,&hF3,&h25,&hEA,&hEA,&hCF
      ! DB &hAF,&h65,&h65,&hCA,&h8E,&h7A,&h7A,&hF4,&hE9,&hAE,&hAE,&h47,&h18,&h08,&h08,&h10
      ! DB &hD5,&hBA,&hBA,&h6F,&h88,&h78,&h78,&hF0,&h6F,&h25,&h25,&h4A,&h72,&h2E,&h2E,&h5C
      ! DB &h24,&h1C,&h1C,&h38,&hF1,&hA6,&hA6,&h57,&hC7,&hB4,&hB4,&h73,&h51,&hC6,&hC6,&h97
      ! DB &h23,&hE8,&hE8,&hCB,&h7C,&hDD,&hDD,&hA1,&h9C,&h74,&h74,&hE8,&h21,&h1F,&h1F,&h3E
      ! DB &hDD,&h4B,&h4B,&h96,&hDC,&hBD,&hBD,&h61,&h86,&h8B,&h8B,&h0D,&h85,&h8A,&h8A,&h0F
      ! DB &h90,&h70,&h70,&hE0,&h42,&h3E,&h3E,&h7C,&hC4,&hB5,&hB5,&h71,&hAA,&h66,&h66,&hCC
      ! DB &hD8,&h48,&h48,&h90,&h05,&h03,&h03,&h06,&h01,&hF6,&hF6,&hF7,&h12,&h0E,&h0E,&h1C
      ! DB &hA3,&h61,&h61,&hC2,&h5F,&h35,&h35,&h6A,&hF9,&h57,&h57,&hAE,&hD0,&hB9,&hB9,&h69
      ! DB &h91,&h86,&h86,&h17,&h58,&hC1,&hC1,&h99,&h27,&h1D,&h1D,&h3A,&hB9,&h9E,&h9E,&h27
      ! DB &h38,&hE1,&hE1,&hD9,&h13,&hF8,&hF8,&hEB,&hB3,&h98,&h98,&h2B,&h33,&h11,&h11,&h22
      ! DB &hBB,&h69,&h69,&hD2,&h70,&hD9,&hD9,&hA9,&h89,&h8E,&h8E,&h07,&hA7,&h94,&h94,&h33
      ! DB &hB6,&h9B,&h9B,&h2D,&h22,&h1E,&h1E,&h3C,&h92,&h87,&h87,&h15,&h20,&hE9,&hE9,&hC9
      ! DB &h49,&hCE,&hCE,&h87,&hFF,&h55,&h55,&hAA,&h78,&h28,&h28,&h50,&h7A,&hDF,&hDF,&hA5
      ! DB &h8F,&h8C,&h8C,&h03,&hF8,&hA1,&hA1,&h59,&h80,&h89,&h89,&h09,&h17,&h0D,&h0D,&h1A
      ! DB &hDA,&hBF,&hBF,&h65,&h31,&hE6,&hE6,&hD7,&hC6,&h42,&h42,&h84,&hB8,&h68,&h68,&hD0
      ! DB &hC3,&h41,&h41,&h82,&hB0,&h99,&h99,&h29,&h77,&h2D,&h2D,&h5A,&h11,&h0F,&h0F,&h1E
      ! DB &hCB,&hB0,&hB0,&h7B,&hFC,&h54,&h54,&hA8,&hD6,&hBB,&hBB,&h6D,&h3A,&h16,&h16,&h2C
      ! DB &h63,&h63,&hC6,&hA5,&h7C,&h7C,&hF8,&h84,&h77,&h77,&hEE,&h99,&h7B,&h7B,&hF6,&h8D
      ! DB &hF2,&hF2,&hFF,&h0D,&h6B,&h6B,&hD6,&hBD,&h6F,&h6F,&hDE,&hB1,&hC5,&hC5,&h91,&h54
      ! DB &h30,&h30,&h60,&h50,&h01,&h01,&h02,&h03,&h67,&h67,&hCE,&hA9,&h2B,&h2B,&h56,&h7D
      ! DB &hFE,&hFE,&hE7,&h19,&hD7,&hD7,&hB5,&h62,&hAB,&hAB,&h4D,&hE6,&h76,&h76,&hEC,&h9A
      ! DB &hCA,&hCA,&h8F,&h45,&h82,&h82,&h1F,&h9D,&hC9,&hC9,&h89,&h40,&h7D,&h7D,&hFA,&h87
      ! DB &hFA,&hFA,&hEF,&h15,&h59,&h59,&hB2,&hEB,&h47,&h47,&h8E,&hC9,&hF0,&hF0,&hFB,&h0B
      ! DB &hAD,&hAD,&h41,&hEC,&hD4,&hD4,&hB3,&h67,&hA2,&hA2,&h5F,&hFD,&hAF,&hAF,&h45,&hEA
      ! DB &h9C,&h9C,&h23,&hBF,&hA4,&hA4,&h53,&hF7,&h72,&h72,&hE4,&h96,&hC0,&hC0,&h9B,&h5B
      ! DB &hB7,&hB7,&h75,&hC2,&hFD,&hFD,&hE1,&h1C,&h93,&h93,&h3D,&hAE,&h26,&h26,&h4C,&h6A
      ! DB &h36,&h36,&h6C,&h5A,&h3F,&h3F,&h7E,&h41,&hF7,&hF7,&hF5,&h02,&hCC,&hCC,&h83,&h4F
      ! DB &h34,&h34,&h68,&h5C,&hA5,&hA5,&h51,&hF4,&hE5,&hE5,&hD1,&h34,&hF1,&hF1,&hF9,&h08
      ! DB &h71,&h71,&hE2,&h93,&hD8,&hD8,&hAB,&h73,&h31,&h31,&h62,&h53,&h15,&h15,&h2A,&h3F
      ! DB &h04,&h04,&h08,&h0C,&hC7,&hC7,&h95,&h52,&h23,&h23,&h46,&h65,&hC3,&hC3,&h9D,&h5E
      ! DB &h18,&h18,&h30,&h28,&h96,&h96,&h37,&hA1,&h05,&h05,&h0A,&h0F,&h9A,&h9A,&h2F,&hB5
      ! DB &h07,&h07,&h0E,&h09,&h12,&h12,&h24,&h36,&h80,&h80,&h1B,&h9B,&hE2,&hE2,&hDF,&h3D
      ! DB &hEB,&hEB,&hCD,&h26,&h27,&h27,&h4E,&h69,&hB2,&hB2,&h7F,&hCD,&h75,&h75,&hEA,&h9F
      ! DB &h09,&h09,&h12,&h1B,&h83,&h83,&h1D,&h9E,&h2C,&h2C,&h58,&h74,&h1A,&h1A,&h34,&h2E
      ! DB &h1B,&h1B,&h36,&h2D,&h6E,&h6E,&hDC,&hB2,&h5A,&h5A,&hB4,&hEE,&hA0,&hA0,&h5B,&hFB
      ! DB &h52,&h52,&hA4,&hF6,&h3B,&h3B,&h76,&h4D,&hD6,&hD6,&hB7,&h61,&hB3,&hB3,&h7D,&hCE
      ! DB &h29,&h29,&h52,&h7B,&hE3,&hE3,&hDD,&h3E,&h2F,&h2F,&h5E,&h71,&h84,&h84,&h13,&h97
      ! DB &h53,&h53,&hA6,&hF5,&hD1,&hD1,&hB9,&h68,&h00,&h00,&h00,&h00,&hED,&hED,&hC1,&h2C
      ! DB &h20,&h20,&h40,&h60,&hFC,&hFC,&hE3,&h1F,&hB1,&hB1,&h79,&hC8,&h5B,&h5B,&hB6,&hED
      ! DB &h6A,&h6A,&hD4,&hBE,&hCB,&hCB,&h8D,&h46,&hBE,&hBE,&h67,&hD9,&h39,&h39,&h72,&h4B
      ! DB &h4A,&h4A,&h94,&hDE,&h4C,&h4C,&h98,&hD4,&h58,&h58,&hB0,&hE8,&hCF,&hCF,&h85,&h4A
      ! DB &hD0,&hD0,&hBB,&h6B,&hEF,&hEF,&hC5,&h2A,&hAA,&hAA,&h4F,&hE5,&hFB,&hFB,&hED,&h16
      ! DB &h43,&h43,&h86,&hC5,&h4D,&h4D,&h9A,&hD7,&h33,&h33,&h66,&h55,&h85,&h85,&h11,&h94
      ! DB &h45,&h45,&h8A,&hCF,&hF9,&hF9,&hE9,&h10,&h02,&h02,&h04,&h06,&h7F,&h7F,&hFE,&h81
      ! DB &h50,&h50,&hA0,&hF0,&h3C,&h3C,&h78,&h44,&h9F,&h9F,&h25,&hBA,&hA8,&hA8,&h4B,&hE3
      ! DB &h51,&h51,&hA2,&hF3,&hA3,&hA3,&h5D,&hFE,&h40,&h40,&h80,&hC0,&h8F,&h8F,&h05,&h8A
      ! DB &h92,&h92,&h3F,&hAD,&h9D,&h9D,&h21,&hBC,&h38,&h38,&h70,&h48,&hF5,&hF5,&hF1,&h04
      ! DB &hBC,&hBC,&h63,&hDF,&hB6,&hB6,&h77,&hC1,&hDA,&hDA,&hAF,&h75,&h21,&h21,&h42,&h63
      ! DB &h10,&h10,&h20,&h30,&hFF,&hFF,&hE5,&h1A,&hF3,&hF3,&hFD,&h0E,&hD2,&hD2,&hBF,&h6D
      ! DB &hCD,&hCD,&h81,&h4C,&h0C,&h0C,&h18,&h14,&h13,&h13,&h26,&h35,&hEC,&hEC,&hC3,&h2F
      ! DB &h5F,&h5F,&hBE,&hE1,&h97,&h97,&h35,&hA2,&h44,&h44,&h88,&hCC,&h17,&h17,&h2E,&h39
      ! DB &hC4,&hC4,&h93,&h57,&hA7,&hA7,&h55,&hF2,&h7E,&h7E,&hFC,&h82,&h3D,&h3D,&h7A,&h47
      ! DB &h64,&h64,&hC8,&hAC,&h5D,&h5D,&hBA,&hE7,&h19,&h19,&h32,&h2B,&h73,&h73,&hE6,&h95
      ! DB &h60,&h60,&hC0,&hA0,&h81,&h81,&h19,&h98,&h4F,&h4F,&h9E,&hD1,&hDC,&hDC,&hA3,&h7F
      ! DB &h22,&h22,&h44,&h66,&h2A,&h2A,&h54,&h7E,&h90,&h90,&h3B,&hAB,&h88,&h88,&h0B,&h83
      ! DB &h46,&h46,&h8C,&hCA,&hEE,&hEE,&hC7,&h29,&hB8,&hB8,&h6B,&hD3,&h14,&h14,&h28,&h3C
      ! DB &hDE,&hDE,&hA7,&h79,&h5E,&h5E,&hBC,&hE2,&h0B,&h0B,&h16,&h1D,&hDB,&hDB,&hAD,&h76
      ! DB &hE0,&hE0,&hDB,&h3B,&h32,&h32,&h64,&h56,&h3A,&h3A,&h74,&h4E,&h0A,&h0A,&h14,&h1E
      ! DB &h49,&h49,&h92,&hDB,&h06,&h06,&h0C,&h0A,&h24,&h24,&h48,&h6C,&h5C,&h5C,&hB8,&hE4
      ! DB &hC2,&hC2,&h9F,&h5D,&hD3,&hD3,&hBD,&h6E,&hAC,&hAC,&h43,&hEF,&h62,&h62,&hC4,&hA6
      ! DB &h91,&h91,&h39,&hA8,&h95,&h95,&h31,&hA4,&hE4,&hE4,&hD3,&h37,&h79,&h79,&hF2,&h8B
      ! DB &hE7,&hE7,&hD5,&h32,&hC8,&hC8,&h8B,&h43,&h37,&h37,&h6E,&h59,&h6D,&h6D,&hDA,&hB7
      ! DB &h8D,&h8D,&h01,&h8C,&hD5,&hD5,&hB1,&h64,&h4E,&h4E,&h9C,&hD2,&hA9,&hA9,&h49,&hE0
      ! DB &h6C,&h6C,&hD8,&hB4,&h56,&h56,&hAC,&hFA,&hF4,&hF4,&hF3,&h07,&hEA,&hEA,&hCF,&h25
      ! DB &h65,&h65,&hCA,&hAF,&h7A,&h7A,&hF4,&h8E,&hAE,&hAE,&h47,&hE9,&h08,&h08,&h10,&h18
      ! DB &hBA,&hBA,&h6F,&hD5,&h78,&h78,&hF0,&h88,&h25,&h25,&h4A,&h6F,&h2E,&h2E,&h5C,&h72
      ! DB &h1C,&h1C,&h38,&h24,&hA6,&hA6,&h57,&hF1,&hB4,&hB4,&h73,&hC7,&hC6,&hC6,&h97,&h51
      ! DB &hE8,&hE8,&hCB,&h23,&hDD,&hDD,&hA1,&h7C,&h74,&h74,&hE8,&h9C,&h1F,&h1F,&h3E,&h21
      ! DB &h4B,&h4B,&h96,&hDD,&hBD,&hBD,&h61,&hDC,&h8B,&h8B,&h0D,&h86,&h8A,&h8A,&h0F,&h85
      ! DB &h70,&h70,&hE0,&h90,&h3E,&h3E,&h7C,&h42,&hB5,&hB5,&h71,&hC4,&h66,&h66,&hCC,&hAA
      ! DB &h48,&h48,&h90,&hD8,&h03,&h03,&h06,&h05,&hF6,&hF6,&hF7,&h01,&h0E,&h0E,&h1C,&h12
      ! DB &h61,&h61,&hC2,&hA3,&h35,&h35,&h6A,&h5F,&h57,&h57,&hAE,&hF9,&hB9,&hB9,&h69,&hD0
      ! DB &h86,&h86,&h17,&h91,&hC1,&hC1,&h99,&h58,&h1D,&h1D,&h3A,&h27,&h9E,&h9E,&h27,&hB9
      ! DB &hE1,&hE1,&hD9,&h38,&hF8,&hF8,&hEB,&h13,&h98,&h98,&h2B,&hB3,&h11,&h11,&h22,&h33
      ! DB &h69,&h69,&hD2,&hBB,&hD9,&hD9,&hA9,&h70,&h8E,&h8E,&h07,&h89,&h94,&h94,&h33,&hA7
      ! DB &h9B,&h9B,&h2D,&hB6,&h1E,&h1E,&h3C,&h22,&h87,&h87,&h15,&h92,&hE9,&hE9,&hC9,&h20
      ! DB &hCE,&hCE,&h87,&h49,&h55,&h55,&hAA,&hFF,&h28,&h28,&h50,&h78,&hDF,&hDF,&hA5,&h7A
      ! DB &h8C,&h8C,&h03,&h8F,&hA1,&hA1,&h59,&hF8,&h89,&h89,&h09,&h80,&h0D,&h0D,&h1A,&h17
      ! DB &hBF,&hBF,&h65,&hDA,&hE6,&hE6,&hD7,&h31,&h42,&h42,&h84,&hC6,&h68,&h68,&hD0,&hB8
      ! DB &h41,&h41,&h82,&hC3,&h99,&h99,&h29,&hB0,&h2D,&h2D,&h5A,&h77,&h0F,&h0F,&h1E,&h11
      ! DB &hB0,&hB0,&h7B,&hCB,&h54,&h54,&hA8,&hFC,&hBB,&hBB,&h6D,&hD6,&h16,&h16,&h2C,&h3A
      ! DB &h63,&hC6,&hA5,&h63,&h7C,&hF8,&h84,&h7C,&h77,&hEE,&h99,&h77,&h7B,&hF6,&h8D,&h7B
      ! DB &hF2,&hFF,&h0D,&hF2,&h6B,&hD6,&hBD,&h6B,&h6F,&hDE,&hB1,&h6F,&hC5,&h91,&h54,&hC5
      ! DB &h30,&h60,&h50,&h30,&h01,&h02,&h03,&h01,&h67,&hCE,&hA9,&h67,&h2B,&h56,&h7D,&h2B
      ! DB &hFE,&hE7,&h19,&hFE,&hD7,&hB5,&h62,&hD7,&hAB,&h4D,&hE6,&hAB,&h76,&hEC,&h9A,&h76
      ! DB &hCA,&h8F,&h45,&hCA,&h82,&h1F,&h9D,&h82,&hC9,&h89,&h40,&hC9,&h7D,&hFA,&h87,&h7D
      ! DB &hFA,&hEF,&h15,&hFA,&h59,&hB2,&hEB,&h59,&h47,&h8E,&hC9,&h47,&hF0,&hFB,&h0B,&hF0
      ! DB &hAD,&h41,&hEC,&hAD,&hD4,&hB3,&h67,&hD4,&hA2,&h5F,&hFD,&hA2,&hAF,&h45,&hEA,&hAF
      ! DB &h9C,&h23,&hBF,&h9C,&hA4,&h53,&hF7,&hA4,&h72,&hE4,&h96,&h72,&hC0,&h9B,&h5B,&hC0
      ! DB &hB7,&h75,&hC2,&hB7,&hFD,&hE1,&h1C,&hFD,&h93,&h3D,&hAE,&h93,&h26,&h4C,&h6A,&h26
      ! DB &h36,&h6C,&h5A,&h36,&h3F,&h7E,&h41,&h3F,&hF7,&hF5,&h02,&hF7,&hCC,&h83,&h4F,&hCC
      ! DB &h34,&h68,&h5C,&h34,&hA5,&h51,&hF4,&hA5,&hE5,&hD1,&h34,&hE5,&hF1,&hF9,&h08,&hF1
      ! DB &h71,&hE2,&h93,&h71,&hD8,&hAB,&h73,&hD8,&h31,&h62,&h53,&h31,&h15,&h2A,&h3F,&h15
      ! DB &h04,&h08,&h0C,&h04,&hC7,&h95,&h52,&hC7,&h23,&h46,&h65,&h23,&hC3,&h9D,&h5E,&hC3
      ! DB &h18,&h30,&h28,&h18,&h96,&h37,&hA1,&h96,&h05,&h0A,&h0F,&h05,&h9A,&h2F,&hB5,&h9A
      ! DB &h07,&h0E,&h09,&h07,&h12,&h24,&h36,&h12,&h80,&h1B,&h9B,&h80,&hE2,&hDF,&h3D,&hE2
      ! DB &hEB,&hCD,&h26,&hEB,&h27,&h4E,&h69,&h27,&hB2,&h7F,&hCD,&hB2,&h75,&hEA,&h9F,&h75
      ! DB &h09,&h12,&h1B,&h09,&h83,&h1D,&h9E,&h83,&h2C,&h58,&h74,&h2C,&h1A,&h34,&h2E,&h1A
      ! DB &h1B,&h36,&h2D,&h1B,&h6E,&hDC,&hB2,&h6E,&h5A,&hB4,&hEE,&h5A,&hA0,&h5B,&hFB,&hA0
      ! DB &h52,&hA4,&hF6,&h52,&h3B,&h76,&h4D,&h3B,&hD6,&hB7,&h61,&hD6,&hB3,&h7D,&hCE,&hB3
      ! DB &h29,&h52,&h7B,&h29,&hE3,&hDD,&h3E,&hE3,&h2F,&h5E,&h71,&h2F,&h84,&h13,&h97,&h84
      ! DB &h53,&hA6,&hF5,&h53,&hD1,&hB9,&h68,&hD1,&h00,&h00,&h00,&h00,&hED,&hC1,&h2C,&hED
      ! DB &h20,&h40,&h60,&h20,&hFC,&hE3,&h1F,&hFC,&hB1,&h79,&hC8,&hB1,&h5B,&hB6,&hED,&h5B
      ! DB &h6A,&hD4,&hBE,&h6A,&hCB,&h8D,&h46,&hCB,&hBE,&h67,&hD9,&hBE,&h39,&h72,&h4B,&h39
      ! DB &h4A,&h94,&hDE,&h4A,&h4C,&h98,&hD4,&h4C,&h58,&hB0,&hE8,&h58,&hCF,&h85,&h4A,&hCF
      ! DB &hD0,&hBB,&h6B,&hD0,&hEF,&hC5,&h2A,&hEF,&hAA,&h4F,&hE5,&hAA,&hFB,&hED,&h16,&hFB
      ! DB &h43,&h86,&hC5,&h43,&h4D,&h9A,&hD7,&h4D,&h33,&h66,&h55,&h33,&h85,&h11,&h94,&h85
      ! DB &h45,&h8A,&hCF,&h45,&hF9,&hE9,&h10,&hF9,&h02,&h04,&h06,&h02,&h7F,&hFE,&h81,&h7F
      ! DB &h50,&hA0,&hF0,&h50,&h3C,&h78,&h44,&h3C,&h9F,&h25,&hBA,&h9F,&hA8,&h4B,&hE3,&hA8
      ! DB &h51,&hA2,&hF3,&h51,&hA3,&h5D,&hFE,&hA3,&h40,&h80,&hC0,&h40,&h8F,&h05,&h8A,&h8F
      ! DB &h92,&h3F,&hAD,&h92,&h9D,&h21,&hBC,&h9D,&h38,&h70,&h48,&h38,&hF5,&hF1,&h04,&hF5
      ! DB &hBC,&h63,&hDF,&hBC,&hB6,&h77,&hC1,&hB6,&hDA,&hAF,&h75,&hDA,&h21,&h42,&h63,&h21
      ! DB &h10,&h20,&h30,&h10,&hFF,&hE5,&h1A,&hFF,&hF3,&hFD,&h0E,&hF3,&hD2,&hBF,&h6D,&hD2
      ! DB &hCD,&h81,&h4C,&hCD,&h0C,&h18,&h14,&h0C,&h13,&h26,&h35,&h13,&hEC,&hC3,&h2F,&hEC
      ! DB &h5F,&hBE,&hE1,&h5F,&h97,&h35,&hA2,&h97,&h44,&h88,&hCC,&h44,&h17,&h2E,&h39,&h17
      ! DB &hC4,&h93,&h57,&hC4,&hA7,&h55,&hF2,&hA7,&h7E,&hFC,&h82,&h7E,&h3D,&h7A,&h47,&h3D
      ! DB &h64,&hC8,&hAC,&h64,&h5D,&hBA,&hE7,&h5D,&h19,&h32,&h2B,&h19,&h73,&hE6,&h95,&h73
      ! DB &h60,&hC0,&hA0,&h60,&h81,&h19,&h98,&h81,&h4F,&h9E,&hD1,&h4F,&hDC,&hA3,&h7F,&hDC
      ! DB &h22,&h44,&h66,&h22,&h2A,&h54,&h7E,&h2A,&h90,&h3B,&hAB,&h90,&h88,&h0B,&h83,&h88
      ! DB &h46,&h8C,&hCA,&h46,&hEE,&hC7,&h29,&hEE,&hB8,&h6B,&hD3,&hB8,&h14,&h28,&h3C,&h14
      ! DB &hDE,&hA7,&h79,&hDE,&h5E,&hBC,&hE2,&h5E,&h0B,&h16,&h1D,&h0B,&hDB,&hAD,&h76,&hDB
      ! DB &hE0,&hDB,&h3B,&hE0,&h32,&h64,&h56,&h32,&h3A,&h74,&h4E,&h3A,&h0A,&h14,&h1E,&h0A
      ! DB &h49,&h92,&hDB,&h49,&h06,&h0C,&h0A,&h06,&h24,&h48,&h6C,&h24,&h5C,&hB8,&hE4,&h5C
      ! DB &hC2,&h9F,&h5D,&hC2,&hD3,&hBD,&h6E,&hD3,&hAC,&h43,&hEF,&hAC,&h62,&hC4,&hA6,&h62
      ! DB &h91,&h39,&hA8,&h91,&h95,&h31,&hA4,&h95,&hE4,&hD3,&h37,&hE4,&h79,&hF2,&h8B,&h79
      ! DB &hE7,&hD5,&h32,&hE7,&hC8,&h8B,&h43,&hC8,&h37,&h6E,&h59,&h37,&h6D,&hDA,&hB7,&h6D
      ! DB &h8D,&h01,&h8C,&h8D,&hD5,&hB1,&h64,&hD5,&h4E,&h9C,&hD2,&h4E,&hA9,&h49,&hE0,&hA9
      ! DB &h6C,&hD8,&hB4,&h6C,&h56,&hAC,&hFA,&h56,&hF4,&hF3,&h07,&hF4,&hEA,&hCF,&h25,&hEA
      ! DB &h65,&hCA,&hAF,&h65,&h7A,&hF4,&h8E,&h7A,&hAE,&h47,&hE9,&hAE,&h08,&h10,&h18,&h08
      ! DB &hBA,&h6F,&hD5,&hBA,&h78,&hF0,&h88,&h78,&h25,&h4A,&h6F,&h25,&h2E,&h5C,&h72,&h2E
      ! DB &h1C,&h38,&h24,&h1C,&hA6,&h57,&hF1,&hA6,&hB4,&h73,&hC7,&hB4,&hC6,&h97,&h51,&hC6
      ! DB &hE8,&hCB,&h23,&hE8,&hDD,&hA1,&h7C,&hDD,&h74,&hE8,&h9C,&h74,&h1F,&h3E,&h21,&h1F
      ! DB &h4B,&h96,&hDD,&h4B,&hBD,&h61,&hDC,&hBD,&h8B,&h0D,&h86,&h8B,&h8A,&h0F,&h85,&h8A
      ! DB &h70,&hE0,&h90,&h70,&h3E,&h7C,&h42,&h3E,&hB5,&h71,&hC4,&hB5,&h66,&hCC,&hAA,&h66
      ! DB &h48,&h90,&hD8,&h48,&h03,&h06,&h05,&h03,&hF6,&hF7,&h01,&hF6,&h0E,&h1C,&h12,&h0E
      ! DB &h61,&hC2,&hA3,&h61,&h35,&h6A,&h5F,&h35,&h57,&hAE,&hF9,&h57,&hB9,&h69,&hD0,&hB9
      ! DB &h86,&h17,&h91,&h86,&hC1,&h99,&h58,&hC1,&h1D,&h3A,&h27,&h1D,&h9E,&h27,&hB9,&h9E
      ! DB &hE1,&hD9,&h38,&hE1,&hF8,&hEB,&h13,&hF8,&h98,&h2B,&hB3,&h98,&h11,&h22,&h33,&h11
      ! DB &h69,&hD2,&hBB,&h69,&hD9,&hA9,&h70,&hD9,&h8E,&h07,&h89,&h8E,&h94,&h33,&hA7,&h94
      ! DB &h9B,&h2D,&hB6,&h9B,&h1E,&h3C,&h22,&h1E,&h87,&h15,&h92,&h87,&hE9,&hC9,&h20,&hE9
      ! DB &hCE,&h87,&h49,&hCE,&h55,&hAA,&hFF,&h55,&h28,&h50,&h78,&h28,&hDF,&hA5,&h7A,&hDF
      ! DB &h8C,&h03,&h8F,&h8C,&hA1,&h59,&hF8,&hA1,&h89,&h09,&h80,&h89,&h0D,&h1A,&h17,&h0D
      ! DB &hBF,&h65,&hDA,&hBF,&hE6,&hD7,&h31,&hE6,&h42,&h84,&hC6,&h42,&h68,&hD0,&hB8,&h68
      ! DB &h41,&h82,&hC3,&h41,&h99,&h29,&hB0,&h99,&h2D,&h5A,&h77,&h2D,&h0F,&h1E,&h11,&h0F
      ! DB &hB0,&h7B,&hCB,&hB0,&h54,&hA8,&hFC,&h54,&hBB,&h6D,&hD6,&hBB,&h16,&h2C,&h3A,&h16
      ! DB &hC6,&hA5,&h63,&h63,&hF8,&h84,&h7C,&h7C,&hEE,&h99,&h77,&h77,&hF6,&h8D,&h7B,&h7B
      ! DB &hFF,&h0D,&hF2,&hF2,&hD6,&hBD,&h6B,&h6B,&hDE,&hB1,&h6F,&h6F,&h91,&h54,&hC5,&hC5
      ! DB &h60,&h50,&h30,&h30,&h02,&h03,&h01,&h01,&hCE,&hA9,&h67,&h67,&h56,&h7D,&h2B,&h2B
      ! DB &hE7,&h19,&hFE,&hFE,&hB5,&h62,&hD7,&hD7,&h4D,&hE6,&hAB,&hAB,&hEC,&h9A,&h76,&h76
      ! DB &h8F,&h45,&hCA,&hCA,&h1F,&h9D,&h82,&h82,&h89,&h40,&hC9,&hC9,&hFA,&h87,&h7D,&h7D
      ! DB &hEF,&h15,&hFA,&hFA,&hB2,&hEB,&h59,&h59,&h8E,&hC9,&h47,&h47,&hFB,&h0B,&hF0,&hF0
      ! DB &h41,&hEC,&hAD,&hAD,&hB3,&h67,&hD4,&hD4,&h5F,&hFD,&hA2,&hA2,&h45,&hEA,&hAF,&hAF
      ! DB &h23,&hBF,&h9C,&h9C,&h53,&hF7,&hA4,&hA4,&hE4,&h96,&h72,&h72,&h9B,&h5B,&hC0,&hC0
      ! DB &h75,&hC2,&hB7,&hB7,&hE1,&h1C,&hFD,&hFD,&h3D,&hAE,&h93,&h93,&h4C,&h6A,&h26,&h26
      ! DB &h6C,&h5A,&h36,&h36,&h7E,&h41,&h3F,&h3F,&hF5,&h02,&hF7,&hF7,&h83,&h4F,&hCC,&hCC
      ! DB &h68,&h5C,&h34,&h34,&h51,&hF4,&hA5,&hA5,&hD1,&h34,&hE5,&hE5,&hF9,&h08,&hF1,&hF1
      ! DB &hE2,&h93,&h71,&h71,&hAB,&h73,&hD8,&hD8,&h62,&h53,&h31,&h31,&h2A,&h3F,&h15,&h15
      ! DB &h08,&h0C,&h04,&h04,&h95,&h52,&hC7,&hC7,&h46,&h65,&h23,&h23,&h9D,&h5E,&hC3,&hC3
      ! DB &h30,&h28,&h18,&h18,&h37,&hA1,&h96,&h96,&h0A,&h0F,&h05,&h05,&h2F,&hB5,&h9A,&h9A
      ! DB &h0E,&h09,&h07,&h07,&h24,&h36,&h12,&h12,&h1B,&h9B,&h80,&h80,&hDF,&h3D,&hE2,&hE2
      ! DB &hCD,&h26,&hEB,&hEB,&h4E,&h69,&h27,&h27,&h7F,&hCD,&hB2,&hB2,&hEA,&h9F,&h75,&h75
      ! DB &h12,&h1B,&h09,&h09,&h1D,&h9E,&h83,&h83,&h58,&h74,&h2C,&h2C,&h34,&h2E,&h1A,&h1A
      ! DB &h36,&h2D,&h1B,&h1B,&hDC,&hB2,&h6E,&h6E,&hB4,&hEE,&h5A,&h5A,&h5B,&hFB,&hA0,&hA0
      ! DB &hA4,&hF6,&h52,&h52,&h76,&h4D,&h3B,&h3B,&hB7,&h61,&hD6,&hD6,&h7D,&hCE,&hB3,&hB3
      ! DB &h52,&h7B,&h29,&h29,&hDD,&h3E,&hE3,&hE3,&h5E,&h71,&h2F,&h2F,&h13,&h97,&h84,&h84
      ! DB &hA6,&hF5,&h53,&h53,&hB9,&h68,&hD1,&hD1,&h00,&h00,&h00,&h00,&hC1,&h2C,&hED,&hED
      ! DB &h40,&h60,&h20,&h20,&hE3,&h1F,&hFC,&hFC,&h79,&hC8,&hB1,&hB1,&hB6,&hED,&h5B,&h5B
      ! DB &hD4,&hBE,&h6A,&h6A,&h8D,&h46,&hCB,&hCB,&h67,&hD9,&hBE,&hBE,&h72,&h4B,&h39,&h39
      ! DB &h94,&hDE,&h4A,&h4A,&h98,&hD4,&h4C,&h4C,&hB0,&hE8,&h58,&h58,&h85,&h4A,&hCF,&hCF
      ! DB &hBB,&h6B,&hD0,&hD0,&hC5,&h2A,&hEF,&hEF,&h4F,&hE5,&hAA,&hAA,&hED,&h16,&hFB,&hFB
      ! DB &h86,&hC5,&h43,&h43,&h9A,&hD7,&h4D,&h4D,&h66,&h55,&h33,&h33,&h11,&h94,&h85,&h85
      ! DB &h8A,&hCF,&h45,&h45,&hE9,&h10,&hF9,&hF9,&h04,&h06,&h02,&h02,&hFE,&h81,&h7F,&h7F
      ! DB &hA0,&hF0,&h50,&h50,&h78,&h44,&h3C,&h3C,&h25,&hBA,&h9F,&h9F,&h4B,&hE3,&hA8,&hA8
      ! DB &hA2,&hF3,&h51,&h51,&h5D,&hFE,&hA3,&hA3,&h80,&hC0,&h40,&h40,&h05,&h8A,&h8F,&h8F
      ! DB &h3F,&hAD,&h92,&h92,&h21,&hBC,&h9D,&h9D,&h70,&h48,&h38,&h38,&hF1,&h04,&hF5,&hF5
      ! DB &h63,&hDF,&hBC,&hBC,&h77,&hC1,&hB6,&hB6,&hAF,&h75,&hDA,&hDA,&h42,&h63,&h21,&h21
      ! DB &h20,&h30,&h10,&h10,&hE5,&h1A,&hFF,&hFF,&hFD,&h0E,&hF3,&hF3,&hBF,&h6D,&hD2,&hD2
      ! DB &h81,&h4C,&hCD,&hCD,&h18,&h14,&h0C,&h0C,&h26,&h35,&h13,&h13,&hC3,&h2F,&hEC,&hEC
      ! DB &hBE,&hE1,&h5F,&h5F,&h35,&hA2,&h97,&h97,&h88,&hCC,&h44,&h44,&h2E,&h39,&h17,&h17
      ! DB &h93,&h57,&hC4,&hC4,&h55,&hF2,&hA7,&hA7,&hFC,&h82,&h7E,&h7E,&h7A,&h47,&h3D,&h3D
      ! DB &hC8,&hAC,&h64,&h64,&hBA,&hE7,&h5D,&h5D,&h32,&h2B,&h19,&h19,&hE6,&h95,&h73,&h73
      ! DB &hC0,&hA0,&h60,&h60,&h19,&h98,&h81,&h81,&h9E,&hD1,&h4F,&h4F,&hA3,&h7F,&hDC,&hDC
      ! DB &h44,&h66,&h22,&h22,&h54,&h7E,&h2A,&h2A,&h3B,&hAB,&h90,&h90,&h0B,&h83,&h88,&h88
      ! DB &h8C,&hCA,&h46,&h46,&hC7,&h29,&hEE,&hEE,&h6B,&hD3,&hB8,&hB8,&h28,&h3C,&h14,&h14
      ! DB &hA7,&h79,&hDE,&hDE,&hBC,&hE2,&h5E,&h5E,&h16,&h1D,&h0B,&h0B,&hAD,&h76,&hDB,&hDB
      ! DB &hDB,&h3B,&hE0,&hE0,&h64,&h56,&h32,&h32,&h74,&h4E,&h3A,&h3A,&h14,&h1E,&h0A,&h0A
      ! DB &h92,&hDB,&h49,&h49,&h0C,&h0A,&h06,&h06,&h48,&h6C,&h24,&h24,&hB8,&hE4,&h5C,&h5C
      ! DB &h9F,&h5D,&hC2,&hC2,&hBD,&h6E,&hD3,&hD3,&h43,&hEF,&hAC,&hAC,&hC4,&hA6,&h62,&h62
      ! DB &h39,&hA8,&h91,&h91,&h31,&hA4,&h95,&h95,&hD3,&h37,&hE4,&hE4,&hF2,&h8B,&h79,&h79
      ! DB &hD5,&h32,&hE7,&hE7,&h8B,&h43,&hC8,&hC8,&h6E,&h59,&h37,&h37,&hDA,&hB7,&h6D,&h6D
      ! DB &h01,&h8C,&h8D,&h8D,&hB1,&h64,&hD5,&hD5,&h9C,&hD2,&h4E,&h4E,&h49,&hE0,&hA9,&hA9
      ! DB &hD8,&hB4,&h6C,&h6C,&hAC,&hFA,&h56,&h56,&hF3,&h07,&hF4,&hF4,&hCF,&h25,&hEA,&hEA
      ! DB &hCA,&hAF,&h65,&h65,&hF4,&h8E,&h7A,&h7A,&h47,&hE9,&hAE,&hAE,&h10,&h18,&h08,&h08
      ! DB &h6F,&hD5,&hBA,&hBA,&hF0,&h88,&h78,&h78,&h4A,&h6F,&h25,&h25,&h5C,&h72,&h2E,&h2E
      ! DB &h38,&h24,&h1C,&h1C,&h57,&hF1,&hA6,&hA6,&h73,&hC7,&hB4,&hB4,&h97,&h51,&hC6,&hC6
      ! DB &hCB,&h23,&hE8,&hE8,&hA1,&h7C,&hDD,&hDD,&hE8,&h9C,&h74,&h74,&h3E,&h21,&h1F,&h1F
      ! DB &h96,&hDD,&h4B,&h4B,&h61,&hDC,&hBD,&hBD,&h0D,&h86,&h8B,&h8B,&h0F,&h85,&h8A,&h8A
      ! DB &hE0,&h90,&h70,&h70,&h7C,&h42,&h3E,&h3E,&h71,&hC4,&hB5,&hB5,&hCC,&hAA,&h66,&h66
      ! DB &h90,&hD8,&h48,&h48,&h06,&h05,&h03,&h03,&hF7,&h01,&hF6,&hF6,&h1C,&h12,&h0E,&h0E
      ! DB &hC2,&hA3,&h61,&h61,&h6A,&h5F,&h35,&h35,&hAE,&hF9,&h57,&h57,&h69,&hD0,&hB9,&hB9
      ! DB &h17,&h91,&h86,&h86,&h99,&h58,&hC1,&hC1,&h3A,&h27,&h1D,&h1D,&h27,&hB9,&h9E,&h9E
      ! DB &hD9,&h38,&hE1,&hE1,&hEB,&h13,&hF8,&hF8,&h2B,&hB3,&h98,&h98,&h22,&h33,&h11,&h11
      ! DB &hD2,&hBB,&h69,&h69,&hA9,&h70,&hD9,&hD9,&h07,&h89,&h8E,&h8E,&h33,&hA7,&h94,&h94
      ! DB &h2D,&hB6,&h9B,&h9B,&h3C,&h22,&h1E,&h1E,&h15,&h92,&h87,&h87,&hC9,&h20,&hE9,&hE9
      ! DB &h87,&h49,&hCE,&hCE,&hAA,&hFF,&h55,&h55,&h50,&h78,&h28,&h28,&hA5,&h7A,&hDF,&hDF
      ! DB &h03,&h8F,&h8C,&h8C,&h59,&hF8,&hA1,&hA1,&h09,&h80,&h89,&h89,&h1A,&h17,&h0D,&h0D
      ! DB &h65,&hDA,&hBF,&hBF,&hD7,&h31,&hE6,&hE6,&h84,&hC6,&h42,&h42,&hD0,&hB8,&h68,&h68
      ! DB &h82,&hC3,&h41,&h41,&h29,&hB0,&h99,&h99,&h5A,&h77,&h2D,&h2D,&h1E,&h11,&h0F,&h0F
      ! DB &h7B,&hCB,&hB0,&hB0,&hA8,&hFC,&h54,&h54,&h6D,&hD6,&hBB,&hBB,&h2C,&h3A,&h16,&h16
      ! DB &h50,&hA7,&hF4,&h51,&h53,&h65,&h41,&h7E,&hC3,&hA4,&h17,&h1A,&h96,&h5E,&h27,&h3A
      ! DB &hCB,&h6B,&hAB,&h3B,&hF1,&h45,&h9D,&h1F,&hAB,&h58,&hFA,&hAC,&h93,&h03,&hE3,&h4B
      ! DB &h55,&hFA,&h30,&h20,&hF6,&h6D,&h76,&hAD,&h91,&h76,&hCC,&h88,&h25,&h4C,&h02,&hF5
      ! DB &hFC,&hD7,&hE5,&h4F,&hD7,&hCB,&h2A,&hC5,&h80,&h44,&h35,&h26,&h8F,&hA3,&h62,&hB5
      ! DB &h49,&h5A,&hB1,&hDE,&h67,&h1B,&hBA,&h25,&h98,&h0E,&hEA,&h45,&hE1,&hC0,&hFE,&h5D
      ! DB &h02,&h75,&h2F,&hC3,&h12,&hF0,&h4C,&h81,&hA3,&h97,&h46,&h8D,&hC6,&hF9,&hD3,&h6B
      ! DB &hE7,&h5F,&h8F,&h03,&h95,&h9C,&h92,&h15,&hEB,&h7A,&h6D,&hBF,&hDA,&h59,&h52,&h95
      ! DB &h2D,&h83,&hBE,&hD4,&hD3,&h21,&h74,&h58,&h29,&h69,&hE0,&h49,&h44,&hC8,&hC9,&h8E
      ! DB &h6A,&h89,&hC2,&h75,&h78,&h79,&h8E,&hF4,&h6B,&h3E,&h58,&h99,&hDD,&h71,&hB9,&h27
      ! DB &hB6,&h4F,&hE1,&hBE,&h17,&hAD,&h88,&hF0,&h66,&hAC,&h20,&hC9,&hB4,&h3A,&hCE,&h7D
      ! DB &h18,&h4A,&hDF,&h63,&h82,&h31,&h1A,&hE5,&h60,&h33,&h51,&h97,&h45,&h7F,&h53,&h62
      ! DB &hE0,&h77,&h64,&hB1,&h84,&hAE,&h6B,&hBB,&h1C,&hA0,&h81,&hFE,&h94,&h2B,&h08,&hF9
      ! DB &h58,&h68,&h48,&h70,&h19,&hFD,&h45,&h8F,&h87,&h6C,&hDE,&h94,&hB7,&hF8,&h7B,&h52
      ! DB &h23,&hD3,&h73,&hAB,&hE2,&h02,&h4B,&h72,&h57,&h8F,&h1F,&hE3,&h2A,&hAB,&h55,&h66
      ! DB &h07,&h28,&hEB,&hB2,&h03,&hC2,&hB5,&h2F,&h9A,&h7B,&hC5,&h86,&hA5,&h08,&h37,&hD3
      ! DB &hF2,&h87,&h28,&h30,&hB2,&hA5,&hBF,&h23,&hBA,&h6A,&h03,&h02,&h5C,&h82,&h16,&hED
      ! DB &h2B,&h1C,&hCF,&h8A,&h92,&hB4,&h79,&hA7,&hF0,&hF2,&h07,&hF3,&hA1,&hE2,&h69,&h4E
      ! DB &hCD,&hF4,&hDA,&h65,&hD5,&hBE,&h05,&h06,&h1F,&h62,&h34,&hD1,&h8A,&hFE,&hA6,&hC4
      ! DB &h9D,&h53,&h2E,&h34,&hA0,&h55,&hF3,&hA2,&h32,&hE1,&h8A,&h05,&h75,&hEB,&hF6,&hA4
      ! DB &h39,&hEC,&h83,&h0B,&hAA,&hEF,&h60,&h40,&h06,&h9F,&h71,&h5E,&h51,&h10,&h6E,&hBD
      ! DB &hF9,&h8A,&h21,&h3E,&h3D,&h06,&hDD,&h96,&hAE,&h05,&h3E,&hDD,&h46,&hBD,&hE6,&h4D
      ! DB &hB5,&h8D,&h54,&h91,&h05,&h5D,&hC4,&h71,&h6F,&hD4,&h06,&h04,&hFF,&h15,&h50,&h60
      ! DB &h24,&hFB,&h98,&h19,&h97,&hE9,&hBD,&hD6,&hCC,&h43,&h40,&h89,&h77,&h9E,&hD9,&h67
      ! DB &hBD,&h42,&hE8,&hB0,&h88,&h8B,&h89,&h07,&h38,&h5B,&h19,&hE7,&hDB,&hEE,&hC8,&h79
      ! DB &h47,&h0A,&h7C,&hA1,&hE9,&h0F,&h42,&h7C,&hC9,&h1E,&h84,&hF8,&h00,&h00,&h00,&h00
      ! DB &h83,&h86,&h80,&h09,&h48,&hED,&h2B,&h32,&hAC,&h70,&h11,&h1E,&h4E,&h72,&h5A,&h6C
      ! DB &hFB,&hFF,&h0E,&hFD,&h56,&h38,&h85,&h0F,&h1E,&hD5,&hAE,&h3D,&h27,&h39,&h2D,&h36
      ! DB &h64,&hD9,&h0F,&h0A,&h21,&hA6,&h5C,&h68,&hD1,&h54,&h5B,&h9B,&h3A,&h2E,&h36,&h24
      ! DB &hB1,&h67,&h0A,&h0C,&h0F,&hE7,&h57,&h93,&hD2,&h96,&hEE,&hB4,&h9E,&h91,&h9B,&h1B
      ! DB &h4F,&hC5,&hC0,&h80,&hA2,&h20,&hDC,&h61,&h69,&h4B,&h77,&h5A,&h16,&h1A,&h12,&h1C
      ! DB &h0A,&hBA,&h93,&hE2,&hE5,&h2A,&hA0,&hC0,&h43,&hE0,&h22,&h3C,&h1D,&h17,&h1B,&h12
      ! DB &h0B,&h0D,&h09,&h0E,&hAD,&hC7,&h8B,&hF2,&hB9,&hA8,&hB6,&h2D,&hC8,&hA9,&h1E,&h14
      ! DB &h85,&h19,&hF1,&h57,&h4C,&h07,&h75,&hAF,&hBB,&hDD,&h99,&hEE,&hFD,&h60,&h7F,&hA3
      ! DB &h9F,&h26,&h01,&hF7,&hBC,&hF5,&h72,&h5C,&hC5,&h3B,&h66,&h44,&h34,&h7E,&hFB,&h5B
      ! DB &h76,&h29,&h43,&h8B,&hDC,&hC6,&h23,&hCB,&h68,&hFC,&hED,&hB6,&h63,&hF1,&hE4,&hB8
      ! DB &hCA,&hDC,&h31,&hD7,&h10,&h85,&h63,&h42,&h40,&h22,&h97,&h13,&h20,&h11,&hC6,&h84
      ! DB &h7D,&h24,&h4A,&h85,&hF8,&h3D,&hBB,&hD2,&h11,&h32,&hF9,&hAE,&h6D,&hA1,&h29,&hC7
      ! DB &h4B,&h2F,&h9E,&h1D,&hF3,&h30,&hB2,&hDC,&hEC,&h52,&h86,&h0D,&hD0,&hE3,&hC1,&h77
      ! DB &h6C,&h16,&hB3,&h2B,&h99,&hB9,&h70,&hA9,&hFA,&h48,&h94,&h11,&h22,&h64,&hE9,&h47
      ! DB &hC4,&h8C,&hFC,&hA8,&h1A,&h3F,&hF0,&hA0,&hD8,&h2C,&h7D,&h56,&hEF,&h90,&h33,&h22
      ! DB &hC7,&h4E,&h49,&h87,&hC1,&hD1,&h38,&hD9,&hFE,&hA2,&hCA,&h8C,&h36,&h0B,&hD4,&h98
      ! DB &hCF,&h81,&hF5,&hA6,&h28,&hDE,&h7A,&hA5,&h26,&h8E,&hB7,&hDA,&hA4,&hBF,&hAD,&h3F
      ! DB &hE4,&h9D,&h3A,&h2C,&h0D,&h92,&h78,&h50,&h9B,&hCC,&h5F,&h6A,&h62,&h46,&h7E,&h54
      ! DB &hC2,&h13,&h8D,&hF6,&hE8,&hB8,&hD8,&h90,&h5E,&hF7,&h39,&h2E,&hF5,&hAF,&hC3,&h82
      ! DB &hBE,&h80,&h5D,&h9F,&h7C,&h93,&hD0,&h69,&hA9,&h2D,&hD5,&h6F,&hB3,&h12,&h25,&hCF
      ! DB &h3B,&h99,&hAC,&hC8,&hA7,&h7D,&h18,&h10,&h6E,&h63,&h9C,&hE8,&h7B,&hBB,&h3B,&hDB
      ! DB &h09,&h78,&h26,&hCD,&hF4,&h18,&h59,&h6E,&h01,&hB7,&h9A,&hEC,&hA8,&h9A,&h4F,&h83
      ! DB &h65,&h6E,&h95,&hE6,&h7E,&hE6,&hFF,&hAA,&h08,&hCF,&hBC,&h21,&hE6,&hE8,&h15,&hEF
      ! DB &hD9,&h9B,&hE7,&hBA,&hCE,&h36,&h6F,&h4A,&hD4,&h09,&h9F,&hEA,&hD6,&h7C,&hB0,&h29
      ! DB &hAF,&hB2,&hA4,&h31,&h31,&h23,&h3F,&h2A,&h30,&h94,&hA5,&hC6,&hC0,&h66,&hA2,&h35
      ! DB &h37,&hBC,&h4E,&h74,&hA6,&hCA,&h82,&hFC,&hB0,&hD0,&h90,&hE0,&h15,&hD8,&hA7,&h33
      ! DB &h4A,&h98,&h04,&hF1,&hF7,&hDA,&hEC,&h41,&h0E,&h50,&hCD,&h7F,&h2F,&hF6,&h91,&h17
      ! DB &h8D,&hD6,&h4D,&h76,&h4D,&hB0,&hEF,&h43,&h54,&h4D,&hAA,&hCC,&hDF,&h04,&h96,&hE4
      ! DB &hE3,&hB5,&hD1,&h9E,&h1B,&h88,&h6A,&h4C,&hB8,&h1F,&h2C,&hC1,&h7F,&h51,&h65,&h46
      ! DB &h04,&hEA,&h5E,&h9D,&h5D,&h35,&h8C,&h01,&h73,&h74,&h87,&hFA,&h2E,&h41,&h0B,&hFB
      ! DB &h5A,&h1D,&h67,&hB3,&h52,&hD2,&hDB,&h92,&h33,&h56,&h10,&hE9,&h13,&h47,&hD6,&h6D
      ! DB &h8C,&h61,&hD7,&h9A,&h7A,&h0C,&hA1,&h37,&h8E,&h14,&hF8,&h59,&h89,&h3C,&h13,&hEB
      ! DB &hEE,&h27,&hA9,&hCE,&h35,&hC9,&h61,&hB7,&hED,&hE5,&h1C,&hE1,&h3C,&hB1,&h47,&h7A
      ! DB &h59,&hDF,&hD2,&h9C,&h3F,&h73,&hF2,&h55,&h79,&hCE,&h14,&h18,&hBF,&h37,&hC7,&h73
      ! DB &hEA,&hCD,&hF7,&h53,&h5B,&hAA,&hFD,&h5F,&h14,&h6F,&h3D,&hDF,&h86,&hDB,&h44,&h78
      ! DB &h81,&hF3,&hAF,&hCA,&h3E,&hC4,&h68,&hB9,&h2C,&h34,&h24,&h38,&h5F,&h40,&hA3,&hC2
      ! DB &h72,&hC3,&h1D,&h16,&h0C,&h25,&hE2,&hBC,&h8B,&h49,&h3C,&h28,&h41,&h95,&h0D,&hFF
      ! DB &h71,&h01,&hA8,&h39,&hDE,&hB3,&h0C,&h08,&h9C,&hE4,&hB4,&hD8,&h90,&hC1,&h56,&h64
      ! DB &h61,&h84,&hCB,&h7B,&h70,&hB6,&h32,&hD5,&h74,&h5C,&h6C,&h48,&h42,&h57,&hB8,&hD0
      ! DB &hA7,&hF4,&h51,&h50,&h65,&h41,&h7E,&h53,&hA4,&h17,&h1A,&hC3,&h5E,&h27,&h3A,&h96
      ! DB &h6B,&hAB,&h3B,&hCB,&h45,&h9D,&h1F,&hF1,&h58,&hFA,&hAC,&hAB,&h03,&hE3,&h4B,&h93
      ! DB &hFA,&h30,&h20,&h55,&h6D,&h76,&hAD,&hF6,&h76,&hCC,&h88,&h91,&h4C,&h02,&hF5,&h25
      ! DB &hD7,&hE5,&h4F,&hFC,&hCB,&h2A,&hC5,&hD7,&h44,&h35,&h26,&h80,&hA3,&h62,&hB5,&h8F
      ! DB &h5A,&hB1,&hDE,&h49,&h1B,&hBA,&h25,&h67,&h0E,&hEA,&h45,&h98,&hC0,&hFE,&h5D,&hE1
      ! DB &h75,&h2F,&hC3,&h02,&hF0,&h4C,&h81,&h12,&h97,&h46,&h8D,&hA3,&hF9,&hD3,&h6B,&hC6
      ! DB &h5F,&h8F,&h03,&hE7,&h9C,&h92,&h15,&h95,&h7A,&h6D,&hBF,&hEB,&h59,&h52,&h95,&hDA
      ! DB &h83,&hBE,&hD4,&h2D,&h21,&h74,&h58,&hD3,&h69,&hE0,&h49,&h29,&hC8,&hC9,&h8E,&h44
      ! DB &h89,&hC2,&h75,&h6A,&h79,&h8E,&hF4,&h78,&h3E,&h58,&h99,&h6B,&h71,&hB9,&h27,&hDD
      ! DB &h4F,&hE1,&hBE,&hB6,&hAD,&h88,&hF0,&h17,&hAC,&h20,&hC9,&h66,&h3A,&hCE,&h7D,&hB4
      ! DB &h4A,&hDF,&h63,&h18,&h31,&h1A,&hE5,&h82,&h33,&h51,&h97,&h60,&h7F,&h53,&h62,&h45
      ! DB &h77,&h64,&hB1,&hE0,&hAE,&h6B,&hBB,&h84,&hA0,&h81,&hFE,&h1C,&h2B,&h08,&hF9,&h94
      ! DB &h68,&h48,&h70,&h58,&hFD,&h45,&h8F,&h19,&h6C,&hDE,&h94,&h87,&hF8,&h7B,&h52,&hB7
      ! DB &hD3,&h73,&hAB,&h23,&h02,&h4B,&h72,&hE2,&h8F,&h1F,&hE3,&h57,&hAB,&h55,&h66,&h2A
      ! DB &h28,&hEB,&hB2,&h07,&hC2,&hB5,&h2F,&h03,&h7B,&hC5,&h86,&h9A,&h08,&h37,&hD3,&hA5
      ! DB &h87,&h28,&h30,&hF2,&hA5,&hBF,&h23,&hB2,&h6A,&h03,&h02,&hBA,&h82,&h16,&hED,&h5C
      ! DB &h1C,&hCF,&h8A,&h2B,&hB4,&h79,&hA7,&h92,&hF2,&h07,&hF3,&hF0,&hE2,&h69,&h4E,&hA1
      ! DB &hF4,&hDA,&h65,&hCD,&hBE,&h05,&h06,&hD5,&h62,&h34,&hD1,&h1F,&hFE,&hA6,&hC4,&h8A
      ! DB &h53,&h2E,&h34,&h9D,&h55,&hF3,&hA2,&hA0,&hE1,&h8A,&h05,&h32,&hEB,&hF6,&hA4,&h75
      ! DB &hEC,&h83,&h0B,&h39,&hEF,&h60,&h40,&hAA,&h9F,&h71,&h5E,&h06,&h10,&h6E,&hBD,&h51
      ! DB &h8A,&h21,&h3E,&hF9,&h06,&hDD,&h96,&h3D,&h05,&h3E,&hDD,&hAE,&hBD,&hE6,&h4D,&h46
      ! DB &h8D,&h54,&h91,&hB5,&h5D,&hC4,&h71,&h05,&hD4,&h06,&h04,&h6F,&h15,&h50,&h60,&hFF
      ! DB &hFB,&h98,&h19,&h24,&hE9,&hBD,&hD6,&h97,&h43,&h40,&h89,&hCC,&h9E,&hD9,&h67,&h77
      ! DB &h42,&hE8,&hB0,&hBD,&h8B,&h89,&h07,&h88,&h5B,&h19,&hE7,&h38,&hEE,&hC8,&h79,&hDB
      ! DB &h0A,&h7C,&hA1,&h47,&h0F,&h42,&h7C,&hE9,&h1E,&h84,&hF8,&hC9,&h00,&h00,&h00,&h00
      ! DB &h86,&h80,&h09,&h83,&hED,&h2B,&h32,&h48,&h70,&h11,&h1E,&hAC,&h72,&h5A,&h6C,&h4E
      ! DB &hFF,&h0E,&hFD,&hFB,&h38,&h85,&h0F,&h56,&hD5,&hAE,&h3D,&h1E,&h39,&h2D,&h36,&h27
      ! DB &hD9,&h0F,&h0A,&h64,&hA6,&h5C,&h68,&h21,&h54,&h5B,&h9B,&hD1,&h2E,&h36,&h24,&h3A
      ! DB &h67,&h0A,&h0C,&hB1,&hE7,&h57,&h93,&h0F,&h96,&hEE,&hB4,&hD2,&h91,&h9B,&h1B,&h9E
      ! DB &hC5,&hC0,&h80,&h4F,&h20,&hDC,&h61,&hA2,&h4B,&h77,&h5A,&h69,&h1A,&h12,&h1C,&h16
      ! DB &hBA,&h93,&hE2,&h0A,&h2A,&hA0,&hC0,&hE5,&hE0,&h22,&h3C,&h43,&h17,&h1B,&h12,&h1D
      ! DB &h0D,&h09,&h0E,&h0B,&hC7,&h8B,&hF2,&hAD,&hA8,&hB6,&h2D,&hB9,&hA9,&h1E,&h14,&hC8
      ! DB &h19,&hF1,&h57,&h85,&h07,&h75,&hAF,&h4C,&hDD,&h99,&hEE,&hBB,&h60,&h7F,&hA3,&hFD
      ! DB &h26,&h01,&hF7,&h9F,&hF5,&h72,&h5C,&hBC,&h3B,&h66,&h44,&hC5,&h7E,&hFB,&h5B,&h34
      ! DB &h29,&h43,&h8B,&h76,&hC6,&h23,&hCB,&hDC,&hFC,&hED,&hB6,&h68,&hF1,&hE4,&hB8,&h63
      ! DB &hDC,&h31,&hD7,&hCA,&h85,&h63,&h42,&h10,&h22,&h97,&h13,&h40,&h11,&hC6,&h84,&h20
      ! DB &h24,&h4A,&h85,&h7D,&h3D,&hBB,&hD2,&hF8,&h32,&hF9,&hAE,&h11,&hA1,&h29,&hC7,&h6D
      ! DB &h2F,&h9E,&h1D,&h4B,&h30,&hB2,&hDC,&hF3,&h52,&h86,&h0D,&hEC,&hE3,&hC1,&h77,&hD0
      ! DB &h16,&hB3,&h2B,&h6C,&hB9,&h70,&hA9,&h99,&h48,&h94,&h11,&hFA,&h64,&hE9,&h47,&h22
      ! DB &h8C,&hFC,&hA8,&hC4,&h3F,&hF0,&hA0,&h1A,&h2C,&h7D,&h56,&hD8,&h90,&h33,&h22,&hEF
      ! DB &h4E,&h49,&h87,&hC7,&hD1,&h38,&hD9,&hC1,&hA2,&hCA,&h8C,&hFE,&h0B,&hD4,&h98,&h36
      ! DB &h81,&hF5,&hA6,&hCF,&hDE,&h7A,&hA5,&h28,&h8E,&hB7,&hDA,&h26,&hBF,&hAD,&h3F,&hA4
      ! DB &h9D,&h3A,&h2C,&hE4,&h92,&h78,&h50,&h0D,&hCC,&h5F,&h6A,&h9B,&h46,&h7E,&h54,&h62
      ! DB &h13,&h8D,&hF6,&hC2,&hB8,&hD8,&h90,&hE8,&hF7,&h39,&h2E,&h5E,&hAF,&hC3,&h82,&hF5
      ! DB &h80,&h5D,&h9F,&hBE,&h93,&hD0,&h69,&h7C,&h2D,&hD5,&h6F,&hA9,&h12,&h25,&hCF,&hB3
      ! DB &h99,&hAC,&hC8,&h3B,&h7D,&h18,&h10,&hA7,&h63,&h9C,&hE8,&h6E,&hBB,&h3B,&hDB,&h7B
      ! DB &h78,&h26,&hCD,&h09,&h18,&h59,&h6E,&hF4,&hB7,&h9A,&hEC,&h01,&h9A,&h4F,&h83,&hA8
      ! DB &h6E,&h95,&hE6,&h65,&hE6,&hFF,&hAA,&h7E,&hCF,&hBC,&h21,&h08,&hE8,&h15,&hEF,&hE6
      ! DB &h9B,&hE7,&hBA,&hD9,&h36,&h6F,&h4A,&hCE,&h09,&h9F,&hEA,&hD4,&h7C,&hB0,&h29,&hD6
      ! DB &hB2,&hA4,&h31,&hAF,&h23,&h3F,&h2A,&h31,&h94,&hA5,&hC6,&h30,&h66,&hA2,&h35,&hC0
      ! DB &hBC,&h4E,&h74,&h37,&hCA,&h82,&hFC,&hA6,&hD0,&h90,&hE0,&hB0,&hD8,&hA7,&h33,&h15
      ! DB &h98,&h04,&hF1,&h4A,&hDA,&hEC,&h41,&hF7,&h50,&hCD,&h7F,&h0E,&hF6,&h91,&h17,&h2F
      ! DB &hD6,&h4D,&h76,&h8D,&hB0,&hEF,&h43,&h4D,&h4D,&hAA,&hCC,&h54,&h04,&h96,&hE4,&hDF
      ! DB &hB5,&hD1,&h9E,&hE3,&h88,&h6A,&h4C,&h1B,&h1F,&h2C,&hC1,&hB8,&h51,&h65,&h46,&h7F
      ! DB &hEA,&h5E,&h9D,&h04,&h35,&h8C,&h01,&h5D,&h74,&h87,&hFA,&h73,&h41,&h0B,&hFB,&h2E
      ! DB &h1D,&h67,&hB3,&h5A,&hD2,&hDB,&h92,&h52,&h56,&h10,&hE9,&h33,&h47,&hD6,&h6D,&h13
      ! DB &h61,&hD7,&h9A,&h8C,&h0C,&hA1,&h37,&h7A,&h14,&hF8,&h59,&h8E,&h3C,&h13,&hEB,&h89
      ! DB &h27,&hA9,&hCE,&hEE,&hC9,&h61,&hB7,&h35,&hE5,&h1C,&hE1,&hED,&hB1,&h47,&h7A,&h3C
      ! DB &hDF,&hD2,&h9C,&h59,&h73,&hF2,&h55,&h3F,&hCE,&h14,&h18,&h79,&h37,&hC7,&h73,&hBF
      ! DB &hCD,&hF7,&h53,&hEA,&hAA,&hFD,&h5F,&h5B,&h6F,&h3D,&hDF,&h14,&hDB,&h44,&h78,&h86
      ! DB &hF3,&hAF,&hCA,&h81,&hC4,&h68,&hB9,&h3E,&h34,&h24,&h38,&h2C,&h40,&hA3,&hC2,&h5F
      ! DB &hC3,&h1D,&h16,&h72,&h25,&hE2,&hBC,&h0C,&h49,&h3C,&h28,&h8B,&h95,&h0D,&hFF,&h41
      ! DB &h01,&hA8,&h39,&h71,&hB3,&h0C,&h08,&hDE,&hE4,&hB4,&hD8,&h9C,&hC1,&h56,&h64,&h90
      ! DB &h84,&hCB,&h7B,&h61,&hB6,&h32,&hD5,&h70,&h5C,&h6C,&h48,&h74,&h57,&hB8,&hD0,&h42
      ! DB &hF4,&h51,&h50,&hA7,&h41,&h7E,&h53,&h65,&h17,&h1A,&hC3,&hA4,&h27,&h3A,&h96,&h5E
      ! DB &hAB,&h3B,&hCB,&h6B,&h9D,&h1F,&hF1,&h45,&hFA,&hAC,&hAB,&h58,&hE3,&h4B,&h93,&h03
      ! DB &h30,&h20,&h55,&hFA,&h76,&hAD,&hF6,&h6D,&hCC,&h88,&h91,&h76,&h02,&hF5,&h25,&h4C
      ! DB &hE5,&h4F,&hFC,&hD7,&h2A,&hC5,&hD7,&hCB,&h35,&h26,&h80,&h44,&h62,&hB5,&h8F,&hA3
      ! DB &hB1,&hDE,&h49,&h5A,&hBA,&h25,&h67,&h1B,&hEA,&h45,&h98,&h0E,&hFE,&h5D,&hE1,&hC0
      ! DB &h2F,&hC3,&h02,&h75,&h4C,&h81,&h12,&hF0,&h46,&h8D,&hA3,&h97,&hD3,&h6B,&hC6,&hF9
      ! DB &h8F,&h03,&hE7,&h5F,&h92,&h15,&h95,&h9C,&h6D,&hBF,&hEB,&h7A,&h52,&h95,&hDA,&h59
      ! DB &hBE,&hD4,&h2D,&h83,&h74,&h58,&hD3,&h21,&hE0,&h49,&h29,&h69,&hC9,&h8E,&h44,&hC8
      ! DB &hC2,&h75,&h6A,&h89,&h8E,&hF4,&h78,&h79,&h58,&h99,&h6B,&h3E,&hB9,&h27,&hDD,&h71
      ! DB &hE1,&hBE,&hB6,&h4F,&h88,&hF0,&h17,&hAD,&h20,&hC9,&h66,&hAC,&hCE,&h7D,&hB4,&h3A
      ! DB &hDF,&h63,&h18,&h4A,&h1A,&hE5,&h82,&h31,&h51,&h97,&h60,&h33,&h53,&h62,&h45,&h7F
      ! DB &h64,&hB1,&hE0,&h77,&h6B,&hBB,&h84,&hAE,&h81,&hFE,&h1C,&hA0,&h08,&hF9,&h94,&h2B
      ! DB &h48,&h70,&h58,&h68,&h45,&h8F,&h19,&hFD,&hDE,&h94,&h87,&h6C,&h7B,&h52,&hB7,&hF8
      ! DB &h73,&hAB,&h23,&hD3,&h4B,&h72,&hE2,&h02,&h1F,&hE3,&h57,&h8F,&h55,&h66,&h2A,&hAB
      ! DB &hEB,&hB2,&h07,&h28,&hB5,&h2F,&h03,&hC2,&hC5,&h86,&h9A,&h7B,&h37,&hD3,&hA5,&h08
      ! DB &h28,&h30,&hF2,&h87,&hBF,&h23,&hB2,&hA5,&h03,&h02,&hBA,&h6A,&h16,&hED,&h5C,&h82
      ! DB &hCF,&h8A,&h2B,&h1C,&h79,&hA7,&h92,&hB4,&h07,&hF3,&hF0,&hF2,&h69,&h4E,&hA1,&hE2
      ! DB &hDA,&h65,&hCD,&hF4,&h05,&h06,&hD5,&hBE,&h34,&hD1,&h1F,&h62,&hA6,&hC4,&h8A,&hFE
      ! DB &h2E,&h34,&h9D,&h53,&hF3,&hA2,&hA0,&h55,&h8A,&h05,&h32,&hE1,&hF6,&hA4,&h75,&hEB
      ! DB &h83,&h0B,&h39,&hEC,&h60,&h40,&hAA,&hEF,&h71,&h5E,&h06,&h9F,&h6E,&hBD,&h51,&h10
      ! DB &h21,&h3E,&hF9,&h8A,&hDD,&h96,&h3D,&h06,&h3E,&hDD,&hAE,&h05,&hE6,&h4D,&h46,&hBD
      ! DB &h54,&h91,&hB5,&h8D,&hC4,&h71,&h05,&h5D,&h06,&h04,&h6F,&hD4,&h50,&h60,&hFF,&h15
      ! DB &h98,&h19,&h24,&hFB,&hBD,&hD6,&h97,&hE9,&h40,&h89,&hCC,&h43,&hD9,&h67,&h77,&h9E
      ! DB &hE8,&hB0,&hBD,&h42,&h89,&h07,&h88,&h8B,&h19,&hE7,&h38,&h5B,&hC8,&h79,&hDB,&hEE
      ! DB &h7C,&hA1,&h47,&h0A,&h42,&h7C,&hE9,&h0F,&h84,&hF8,&hC9,&h1E,&h00,&h00,&h00,&h00
      ! DB &h80,&h09,&h83,&h86,&h2B,&h32,&h48,&hED,&h11,&h1E,&hAC,&h70,&h5A,&h6C,&h4E,&h72
      ! DB &h0E,&hFD,&hFB,&hFF,&h85,&h0F,&h56,&h38,&hAE,&h3D,&h1E,&hD5,&h2D,&h36,&h27,&h39
      ! DB &h0F,&h0A,&h64,&hD9,&h5C,&h68,&h21,&hA6,&h5B,&h9B,&hD1,&h54,&h36,&h24,&h3A,&h2E
      ! DB &h0A,&h0C,&hB1,&h67,&h57,&h93,&h0F,&hE7,&hEE,&hB4,&hD2,&h96,&h9B,&h1B,&h9E,&h91
      ! DB &hC0,&h80,&h4F,&hC5,&hDC,&h61,&hA2,&h20,&h77,&h5A,&h69,&h4B,&h12,&h1C,&h16,&h1A
      ! DB &h93,&hE2,&h0A,&hBA,&hA0,&hC0,&hE5,&h2A,&h22,&h3C,&h43,&hE0,&h1B,&h12,&h1D,&h17
      ! DB &h09,&h0E,&h0B,&h0D,&h8B,&hF2,&hAD,&hC7,&hB6,&h2D,&hB9,&hA8,&h1E,&h14,&hC8,&hA9
      ! DB &hF1,&h57,&h85,&h19,&h75,&hAF,&h4C,&h07,&h99,&hEE,&hBB,&hDD,&h7F,&hA3,&hFD,&h60
      ! DB &h01,&hF7,&h9F,&h26,&h72,&h5C,&hBC,&hF5,&h66,&h44,&hC5,&h3B,&hFB,&h5B,&h34,&h7E
      ! DB &h43,&h8B,&h76,&h29,&h23,&hCB,&hDC,&hC6,&hED,&hB6,&h68,&hFC,&hE4,&hB8,&h63,&hF1
      ! DB &h31,&hD7,&hCA,&hDC,&h63,&h42,&h10,&h85,&h97,&h13,&h40,&h22,&hC6,&h84,&h20,&h11
      ! DB &h4A,&h85,&h7D,&h24,&hBB,&hD2,&hF8,&h3D,&hF9,&hAE,&h11,&h32,&h29,&hC7,&h6D,&hA1
      ! DB &h9E,&h1D,&h4B,&h2F,&hB2,&hDC,&hF3,&h30,&h86,&h0D,&hEC,&h52,&hC1,&h77,&hD0,&hE3
      ! DB &hB3,&h2B,&h6C,&h16,&h70,&hA9,&h99,&hB9,&h94,&h11,&hFA,&h48,&hE9,&h47,&h22,&h64
      ! DB &hFC,&hA8,&hC4,&h8C,&hF0,&hA0,&h1A,&h3F,&h7D,&h56,&hD8,&h2C,&h33,&h22,&hEF,&h90
      ! DB &h49,&h87,&hC7,&h4E,&h38,&hD9,&hC1,&hD1,&hCA,&h8C,&hFE,&hA2,&hD4,&h98,&h36,&h0B
      ! DB &hF5,&hA6,&hCF,&h81,&h7A,&hA5,&h28,&hDE,&hB7,&hDA,&h26,&h8E,&hAD,&h3F,&hA4,&hBF
      ! DB &h3A,&h2C,&hE4,&h9D,&h78,&h50,&h0D,&h92,&h5F,&h6A,&h9B,&hCC,&h7E,&h54,&h62,&h46
      ! DB &h8D,&hF6,&hC2,&h13,&hD8,&h90,&hE8,&hB8,&h39,&h2E,&h5E,&hF7,&hC3,&h82,&hF5,&hAF
      ! DB &h5D,&h9F,&hBE,&h80,&hD0,&h69,&h7C,&h93,&hD5,&h6F,&hA9,&h2D,&h25,&hCF,&hB3,&h12
      ! DB &hAC,&hC8,&h3B,&h99,&h18,&h10,&hA7,&h7D,&h9C,&hE8,&h6E,&h63,&h3B,&hDB,&h7B,&hBB
      ! DB &h26,&hCD,&h09,&h78,&h59,&h6E,&hF4,&h18,&h9A,&hEC,&h01,&hB7,&h4F,&h83,&hA8,&h9A
      ! DB &h95,&hE6,&h65,&h6E,&hFF,&hAA,&h7E,&hE6,&hBC,&h21,&h08,&hCF,&h15,&hEF,&hE6,&hE8
      ! DB &hE7,&hBA,&hD9,&h9B,&h6F,&h4A,&hCE,&h36,&h9F,&hEA,&hD4,&h09,&hB0,&h29,&hD6,&h7C
      ! DB &hA4,&h31,&hAF,&hB2,&h3F,&h2A,&h31,&h23,&hA5,&hC6,&h30,&h94,&hA2,&h35,&hC0,&h66
      ! DB &h4E,&h74,&h37,&hBC,&h82,&hFC,&hA6,&hCA,&h90,&hE0,&hB0,&hD0,&hA7,&h33,&h15,&hD8
      ! DB &h04,&hF1,&h4A,&h98,&hEC,&h41,&hF7,&hDA,&hCD,&h7F,&h0E,&h50,&h91,&h17,&h2F,&hF6
      ! DB &h4D,&h76,&h8D,&hD6,&hEF,&h43,&h4D,&hB0,&hAA,&hCC,&h54,&h4D,&h96,&hE4,&hDF,&h04
      ! DB &hD1,&h9E,&hE3,&hB5,&h6A,&h4C,&h1B,&h88,&h2C,&hC1,&hB8,&h1F,&h65,&h46,&h7F,&h51
      ! DB &h5E,&h9D,&h04,&hEA,&h8C,&h01,&h5D,&h35,&h87,&hFA,&h73,&h74,&h0B,&hFB,&h2E,&h41
      ! DB &h67,&hB3,&h5A,&h1D,&hDB,&h92,&h52,&hD2,&h10,&hE9,&h33,&h56,&hD6,&h6D,&h13,&h47
      ! DB &hD7,&h9A,&h8C,&h61,&hA1,&h37,&h7A,&h0C,&hF8,&h59,&h8E,&h14,&h13,&hEB,&h89,&h3C
      ! DB &hA9,&hCE,&hEE,&h27,&h61,&hB7,&h35,&hC9,&h1C,&hE1,&hED,&hE5,&h47,&h7A,&h3C,&hB1
      ! DB &hD2,&h9C,&h59,&hDF,&hF2,&h55,&h3F,&h73,&h14,&h18,&h79,&hCE,&hC7,&h73,&hBF,&h37
      ! DB &hF7,&h53,&hEA,&hCD,&hFD,&h5F,&h5B,&hAA,&h3D,&hDF,&h14,&h6F,&h44,&h78,&h86,&hDB
      ! DB &hAF,&hCA,&h81,&hF3,&h68,&hB9,&h3E,&hC4,&h24,&h38,&h2C,&h34,&hA3,&hC2,&h5F,&h40
      ! DB &h1D,&h16,&h72,&hC3,&hE2,&hBC,&h0C,&h25,&h3C,&h28,&h8B,&h49,&h0D,&hFF,&h41,&h95
      ! DB &hA8,&h39,&h71,&h01,&h0C,&h08,&hDE,&hB3,&hB4,&hD8,&h9C,&hE4,&h56,&h64,&h90,&hC1
      ! DB &hCB,&h7B,&h61,&h84,&h32,&hD5,&h70,&hB6,&h6C,&h48,&h74,&h5C,&hB8,&hD0,&h42,&h57
      ! DB &h51,&h50,&hA7,&hF4,&h7E,&h53,&h65,&h41,&h1A,&hC3,&hA4,&h17,&h3A,&h96,&h5E,&h27
      ! DB &h3B,&hCB,&h6B,&hAB,&h1F,&hF1,&h45,&h9D,&hAC,&hAB,&h58,&hFA,&h4B,&h93,&h03,&hE3
      ! DB &h20,&h55,&hFA,&h30,&hAD,&hF6,&h6D,&h76,&h88,&h91,&h76,&hCC,&hF5,&h25,&h4C,&h02
      ! DB &h4F,&hFC,&hD7,&hE5,&hC5,&hD7,&hCB,&h2A,&h26,&h80,&h44,&h35,&hB5,&h8F,&hA3,&h62
      ! DB &hDE,&h49,&h5A,&hB1,&h25,&h67,&h1B,&hBA,&h45,&h98,&h0E,&hEA,&h5D,&hE1,&hC0,&hFE
      ! DB &hC3,&h02,&h75,&h2F,&h81,&h12,&hF0,&h4C,&h8D,&hA3,&h97,&h46,&h6B,&hC6,&hF9,&hD3
      ! DB &h03,&hE7,&h5F,&h8F,&h15,&h95,&h9C,&h92,&hBF,&hEB,&h7A,&h6D,&h95,&hDA,&h59,&h52
      ! DB &hD4,&h2D,&h83,&hBE,&h58,&hD3,&h21,&h74,&h49,&h29,&h69,&hE0,&h8E,&h44,&hC8,&hC9
      ! DB &h75,&h6A,&h89,&hC2,&hF4,&h78,&h79,&h8E,&h99,&h6B,&h3E,&h58,&h27,&hDD,&h71,&hB9
      ! DB &hBE,&hB6,&h4F,&hE1,&hF0,&h17,&hAD,&h88,&hC9,&h66,&hAC,&h20,&h7D,&hB4,&h3A,&hCE
      ! DB &h63,&h18,&h4A,&hDF,&hE5,&h82,&h31,&h1A,&h97,&h60,&h33,&h51,&h62,&h45,&h7F,&h53
      ! DB &hB1,&hE0,&h77,&h64,&hBB,&h84,&hAE,&h6B,&hFE,&h1C,&hA0,&h81,&hF9,&h94,&h2B,&h08
      ! DB &h70,&h58,&h68,&h48,&h8F,&h19,&hFD,&h45,&h94,&h87,&h6C,&hDE,&h52,&hB7,&hF8,&h7B
      ! DB &hAB,&h23,&hD3,&h73,&h72,&hE2,&h02,&h4B,&hE3,&h57,&h8F,&h1F,&h66,&h2A,&hAB,&h55
      ! DB &hB2,&h07,&h28,&hEB,&h2F,&h03,&hC2,&hB5,&h86,&h9A,&h7B,&hC5,&hD3,&hA5,&h08,&h37
      ! DB &h30,&hF2,&h87,&h28,&h23,&hB2,&hA5,&hBF,&h02,&hBA,&h6A,&h03,&hED,&h5C,&h82,&h16
      ! DB &h8A,&h2B,&h1C,&hCF,&hA7,&h92,&hB4,&h79,&hF3,&hF0,&hF2,&h07,&h4E,&hA1,&hE2,&h69
      ! DB &h65,&hCD,&hF4,&hDA,&h06,&hD5,&hBE,&h05,&hD1,&h1F,&h62,&h34,&hC4,&h8A,&hFE,&hA6
      ! DB &h34,&h9D,&h53,&h2E,&hA2,&hA0,&h55,&hF3,&h05,&h32,&hE1,&h8A,&hA4,&h75,&hEB,&hF6
      ! DB &h0B,&h39,&hEC,&h83,&h40,&hAA,&hEF,&h60,&h5E,&h06,&h9F,&h71,&hBD,&h51,&h10,&h6E
      ! DB &h3E,&hF9,&h8A,&h21,&h96,&h3D,&h06,&hDD,&hDD,&hAE,&h05,&h3E,&h4D,&h46,&hBD,&hE6
      ! DB &h91,&hB5,&h8D,&h54,&h71,&h05,&h5D,&hC4,&h04,&h6F,&hD4,&h06,&h60,&hFF,&h15,&h50
      ! DB &h19,&h24,&hFB,&h98,&hD6,&h97,&hE9,&hBD,&h89,&hCC,&h43,&h40,&h67,&h77,&h9E,&hD9
      ! DB &hB0,&hBD,&h42,&hE8,&h07,&h88,&h8B,&h89,&hE7,&h38,&h5B,&h19,&h79,&hDB,&hEE,&hC8
      ! DB &hA1,&h47,&h0A,&h7C,&h7C,&hE9,&h0F,&h42,&hF8,&hC9,&h1E,&h84,&h00,&h00,&h00,&h00
      ! DB &h09,&h83,&h86,&h80,&h32,&h48,&hED,&h2B,&h1E,&hAC,&h70,&h11,&h6C,&h4E,&h72,&h5A
      ! DB &hFD,&hFB,&hFF,&h0E,&h0F,&h56,&h38,&h85,&h3D,&h1E,&hD5,&hAE,&h36,&h27,&h39,&h2D
      ! DB &h0A,&h64,&hD9,&h0F,&h68,&h21,&hA6,&h5C,&h9B,&hD1,&h54,&h5B,&h24,&h3A,&h2E,&h36
      ! DB &h0C,&hB1,&h67,&h0A,&h93,&h0F,&hE7,&h57,&hB4,&hD2,&h96,&hEE,&h1B,&h9E,&h91,&h9B
      ! DB &h80,&h4F,&hC5,&hC0,&h61,&hA2,&h20,&hDC,&h5A,&h69,&h4B,&h77,&h1C,&h16,&h1A,&h12
      ! DB &hE2,&h0A,&hBA,&h93,&hC0,&hE5,&h2A,&hA0,&h3C,&h43,&hE0,&h22,&h12,&h1D,&h17,&h1B
      ! DB &h0E,&h0B,&h0D,&h09,&hF2,&hAD,&hC7,&h8B,&h2D,&hB9,&hA8,&hB6,&h14,&hC8,&hA9,&h1E
      ! DB &h57,&h85,&h19,&hF1,&hAF,&h4C,&h07,&h75,&hEE,&hBB,&hDD,&h99,&hA3,&hFD,&h60,&h7F
      ! DB &hF7,&h9F,&h26,&h01,&h5C,&hBC,&hF5,&h72,&h44,&hC5,&h3B,&h66,&h5B,&h34,&h7E,&hFB
      ! DB &h8B,&h76,&h29,&h43,&hCB,&hDC,&hC6,&h23,&hB6,&h68,&hFC,&hED,&hB8,&h63,&hF1,&hE4
      ! DB &hD7,&hCA,&hDC,&h31,&h42,&h10,&h85,&h63,&h13,&h40,&h22,&h97,&h84,&h20,&h11,&hC6
      ! DB &h85,&h7D,&h24,&h4A,&hD2,&hF8,&h3D,&hBB,&hAE,&h11,&h32,&hF9,&hC7,&h6D,&hA1,&h29
      ! DB &h1D,&h4B,&h2F,&h9E,&hDC,&hF3,&h30,&hB2,&h0D,&hEC,&h52,&h86,&h77,&hD0,&hE3,&hC1
      ! DB &h2B,&h6C,&h16,&hB3,&hA9,&h99,&hB9,&h70,&h11,&hFA,&h48,&h94,&h47,&h22,&h64,&hE9
      ! DB &hA8,&hC4,&h8C,&hFC,&hA0,&h1A,&h3F,&hF0,&h56,&hD8,&h2C,&h7D,&h22,&hEF,&h90,&h33
      ! DB &h87,&hC7,&h4E,&h49,&hD9,&hC1,&hD1,&h38,&h8C,&hFE,&hA2,&hCA,&h98,&h36,&h0B,&hD4
      ! DB &hA6,&hCF,&h81,&hF5,&hA5,&h28,&hDE,&h7A,&hDA,&h26,&h8E,&hB7,&h3F,&hA4,&hBF,&hAD
      ! DB &h2C,&hE4,&h9D,&h3A,&h50,&h0D,&h92,&h78,&h6A,&h9B,&hCC,&h5F,&h54,&h62,&h46,&h7E
      ! DB &hF6,&hC2,&h13,&h8D,&h90,&hE8,&hB8,&hD8,&h2E,&h5E,&hF7,&h39,&h82,&hF5,&hAF,&hC3
      ! DB &h9F,&hBE,&h80,&h5D,&h69,&h7C,&h93,&hD0,&h6F,&hA9,&h2D,&hD5,&hCF,&hB3,&h12,&h25
      ! DB &hC8,&h3B,&h99,&hAC,&h10,&hA7,&h7D,&h18,&hE8,&h6E,&h63,&h9C,&hDB,&h7B,&hBB,&h3B
      ! DB &hCD,&h09,&h78,&h26,&h6E,&hF4,&h18,&h59,&hEC,&h01,&hB7,&h9A,&h83,&hA8,&h9A,&h4F
      ! DB &hE6,&h65,&h6E,&h95,&hAA,&h7E,&hE6,&hFF,&h21,&h08,&hCF,&hBC,&hEF,&hE6,&hE8,&h15
      ! DB &hBA,&hD9,&h9B,&hE7,&h4A,&hCE,&h36,&h6F,&hEA,&hD4,&h09,&h9F,&h29,&hD6,&h7C,&hB0
      ! DB &h31,&hAF,&hB2,&hA4,&h2A,&h31,&h23,&h3F,&hC6,&h30,&h94,&hA5,&h35,&hC0,&h66,&hA2
      ! DB &h74,&h37,&hBC,&h4E,&hFC,&hA6,&hCA,&h82,&hE0,&hB0,&hD0,&h90,&h33,&h15,&hD8,&hA7
      ! DB &hF1,&h4A,&h98,&h04,&h41,&hF7,&hDA,&hEC,&h7F,&h0E,&h50,&hCD,&h17,&h2F,&hF6,&h91
      ! DB &h76,&h8D,&hD6,&h4D,&h43,&h4D,&hB0,&hEF,&hCC,&h54,&h4D,&hAA,&hE4,&hDF,&h04,&h96
      ! DB &h9E,&hE3,&hB5,&hD1,&h4C,&h1B,&h88,&h6A,&hC1,&hB8,&h1F,&h2C,&h46,&h7F,&h51,&h65
      ! DB &h9D,&h04,&hEA,&h5E,&h01,&h5D,&h35,&h8C,&hFA,&h73,&h74,&h87,&hFB,&h2E,&h41,&h0B
      ! DB &hB3,&h5A,&h1D,&h67,&h92,&h52,&hD2,&hDB,&hE9,&h33,&h56,&h10,&h6D,&h13,&h47,&hD6
      ! DB &h9A,&h8C,&h61,&hD7,&h37,&h7A,&h0C,&hA1,&h59,&h8E,&h14,&hF8,&hEB,&h89,&h3C,&h13
      ! DB &hCE,&hEE,&h27,&hA9,&hB7,&h35,&hC9,&h61,&hE1,&hED,&hE5,&h1C,&h7A,&h3C,&hB1,&h47
      ! DB &h9C,&h59,&hDF,&hD2,&h55,&h3F,&h73,&hF2,&h18,&h79,&hCE,&h14,&h73,&hBF,&h37,&hC7
      ! DB &h53,&hEA,&hCD,&hF7,&h5F,&h5B,&hAA,&hFD,&hDF,&h14,&h6F,&h3D,&h78,&h86,&hDB,&h44
      ! DB &hCA,&h81,&hF3,&hAF,&hB9,&h3E,&hC4,&h68,&h38,&h2C,&h34,&h24,&hC2,&h5F,&h40,&hA3
      ! DB &h16,&h72,&hC3,&h1D,&hBC,&h0C,&h25,&hE2,&h28,&h8B,&h49,&h3C,&hFF,&h41,&h95,&h0D
      ! DB &h39,&h71,&h01,&hA8,&h08,&hDE,&hB3,&h0C,&hD8,&h9C,&hE4,&hB4,&h64,&h90,&hC1,&h56
      ! DB &h7B,&h61,&h84,&hCB,&hD5,&h70,&hB6,&h32,&h48,&h74,&h5C,&h6C,&hD0,&h42,&h57,&hB8
      ! DB &h63,&h7C,&h77,&h7B,&hF2,&h6B,&h6F,&hC5,&h30,&h01,&h67,&h2B,&hFE,&hD7,&hAB,&h76
      ! DB &hCA,&h82,&hC9,&h7D,&hFA,&h59,&h47,&hF0,&hAD,&hD4,&hA2,&hAF,&h9C,&hA4,&h72,&hC0
      ! DB &hB7,&hFD,&h93,&h26,&h36,&h3F,&hF7,&hCC,&h34,&hA5,&hE5,&hF1,&h71,&hD8,&h31,&h15
      ! DB &h04,&hC7,&h23,&hC3,&h18,&h96,&h05,&h9A,&h07,&h12,&h80,&hE2,&hEB,&h27,&hB2,&h75
      ! DB &h09,&h83,&h2C,&h1A,&h1B,&h6E,&h5A,&hA0,&h52,&h3B,&hD6,&hB3,&h29,&hE3,&h2F,&h84
      ! DB &h53,&hD1,&h00,&hED,&h20,&hFC,&hB1,&h5B,&h6A,&hCB,&hBE,&h39,&h4A,&h4C,&h58,&hCF
      ! DB &hD0,&hEF,&hAA,&hFB,&h43,&h4D,&h33,&h85,&h45,&hF9,&h02,&h7F,&h50,&h3C,&h9F,&hA8
      ! DB &h51,&hA3,&h40,&h8F,&h92,&h9D,&h38,&hF5,&hBC,&hB6,&hDA,&h21,&h10,&hFF,&hF3,&hD2
      ! DB &hCD,&h0C,&h13,&hEC,&h5F,&h97,&h44,&h17,&hC4,&hA7,&h7E,&h3D,&h64,&h5D,&h19,&h73
      ! DB &h60,&h81,&h4F,&hDC,&h22,&h2A,&h90,&h88,&h46,&hEE,&hB8,&h14,&hDE,&h5E,&h0B,&hDB
      ! DB &hE0,&h32,&h3A,&h0A,&h49,&h06,&h24,&h5C,&hC2,&hD3,&hAC,&h62,&h91,&h95,&hE4,&h79
      ! DB &hE7,&hC8,&h37,&h6D,&h8D,&hD5,&h4E,&hA9,&h6C,&h56,&hF4,&hEA,&h65,&h7A,&hAE,&h08
      ! DB &hBA,&h78,&h25,&h2E,&h1C,&hA6,&hB4,&hC6,&hE8,&hDD,&h74,&h1F,&h4B,&hBD,&h8B,&h8A
      ! DB &h70,&h3E,&hB5,&h66,&h48,&h03,&hF6,&h0E,&h61,&h35,&h57,&hB9,&h86,&hC1,&h1D,&h9E
      ! DB &hE1,&hF8,&h98,&h11,&h69,&hD9,&h8E,&h94,&h9B,&h1E,&h87,&hE9,&hCE,&h55,&h28,&hDF
      ! DB &h8C,&hA1,&h89,&h0D,&hBF,&hE6,&h42,&h68,&h41,&h99,&h2D,&h0F,&hB0,&h54,&hBB,&h16
      ! DB &h52,&h09,&h6A,&hD5,&h30,&h36,&hA5,&h38,&hBF,&h40,&hA3,&h9E,&h81,&hF3,&hD7,&hFB
      ! DB &h7C,&hE3,&h39,&h82,&h9B,&h2F,&hFF,&h87,&h34,&h8E,&h43,&h44,&hC4,&hDE,&hE9,&hCB
      ! DB &h54,&h7B,&h94,&h32,&hA6,&hC2,&h23,&h3D,&hEE,&h4C,&h95,&h0B,&h42,&hFA,&hC3,&h4E
      ! DB &h08,&h2E,&hA1,&h66,&h28,&hD9,&h24,&hB2,&h76,&h5B,&hA2,&h49,&h6D,&h8B,&hD1,&h25
      ! DB &h72,&hF8,&hF6,&h64,&h86,&h68,&h98,&h16,&hD4,&hA4,&h5C,&hCC,&h5D,&h65,&hB6,&h92
      ! DB &h6C,&h70,&h48,&h50,&hFD,&hED,&hB9,&hDA,&h5E,&h15,&h46,&h57,&hA7,&h8D,&h9D,&h84
      ! DB &h90,&hD8,&hAB,&h00,&h8C,&hBC,&hD3,&h0A,&hF7,&hE4,&h58,&h05,&hB8,&hB3,&h45,&h06
      ! DB &hD0,&h2C,&h1E,&h8F,&hCA,&h3F,&h0F,&h02,&hC1,&hAF,&hBD,&h03,&h01,&h13,&h8A,&h6B
      ! DB &h3A,&h91,&h11,&h41,&h4F,&h67,&hDC,&hEA,&h97,&hF2,&hCF,&hCE,&hF0,&hB4,&hE6,&h73
      ! DB &h96,&hAC,&h74,&h22,&hE7,&hAD,&h35,&h85,&hE2,&hF9,&h37,&hE8,&h1C,&h75,&hDF,&h6E
      ! DB &h47,&hF1,&h1A,&h71,&h1D,&h29,&hC5,&h89,&h6F,&hB7,&h62,&h0E,&hAA,&h18,&hBE,&h1B
      ! DB &hFC,&h56,&h3E,&h4B,&hC6,&hD2,&h79,&h20,&h9A,&hDB,&hC0,&hFE,&h78,&hCD,&h5A,&hF4
      ! DB &h1F,&hDD,&hA8,&h33,&h88,&h07,&hC7,&h31,&hB1,&h12,&h10,&h59,&h27,&h80,&hEC,&h5F
      ! DB &h60,&h51,&h7F,&hA9,&h19,&hB5,&h4A,&h0D,&h2D,&hE5,&h7A,&h9F,&h93,&hC9,&h9C,&hEF
      ! DB &hA0,&hE0,&h3B,&h4D,&hAE,&h2A,&hF5,&hB0,&hC8,&hEB,&hBB,&h3C,&h83,&h53,&h99,&h61
      ! DB &h17,&h2B,&h04,&h7E,&hBA,&h77,&hD6,&h26,&hE1,&h69,&h14,&h63,&h55,&h21,&h0C,&h7D
      ! DB &h00,&h00,&h00,&h01,&h00,&h00,&h00,&h02,&h00,&h00,&h00,&h04,&h00,&h00,&h00,&h08
      ! DB &h00,&h00,&h00,&h10,&h00,&h00,&h00,&h20,&h00,&h00,&h00,&h40,&h00,&h00,&h00,&h80
      ! DB &h00,&h00,&h00,&h1B,&h00,&h00,&h00,&h36
    END SUB

  • #2
    I get ~12500 tix for the set_key call, which would equate to ~125,000,000 tix for a 1GB file. That's only a small fraction of a second for a very big file.

    Comment


    • #3
      Do I have to pass again and again the same password to the encrypt_buffer()?
      Within the encrypt_buffer() will always the function Set_Key() called. This costs performance.
      See my reply in the thread you refer to. And no. SetKey() is, of course, called once only.

      Comment


      • #4
        1)
        Is the implementation really correct?
        Can I encrypt a file as above?
        Is there a standard method for AES encryption of large files?

        2)
        And: Not missing the key-generator SHA256?
        Last edited by Bernhard Fomm; 23 Oct 2009, 04:21 AM.

        Comment


        • #5
          Originally posted by Bernhard Fomm View Post
          1)
          Is there a standard method for AES encryption of large files?
          Bernhard, back in 2005 you promised me that you understood ... Revisit my explanation on ECB, CBC, CFB, OFB, ..
          There is not really a standard method. CBC is often used.

          Kind regards
          Eddy

          Comment


          • #6
            Yes. I understood you in 2005.

            However, if my doctor says something,
            I understand him even theoretically.

            And now I have grown old again four years.

            I'm not sure with the correct AES implementation for file encryption.

            From your point of view If my small sample in order?
            I have your HIME functions. Can you give an example?

            Comment


            • #7
              Bernhard. This is a small demo program using HIME library to encrypt and decrypt a file with AES in CBC mode.
              This example assumes that you can load the file into memory as a whole. If the file is too large to load into memory, you can use the technique you used in your program. That is to read the file in parts, encrypt part by part and save the encrypted parts to file.
              Except, this time the part size can be very large. It is not limited to AES block size.


              Code:
              '====================================================================
              '============ HIME demo program to show AES encryption and decryption
              '====================================================================
              #COMPILE EXE
              #DIM ALL
              
              '--------------------------------------------------------------------------------
              '   ** Includes **
              '--------------------------------------------------------------------------------
              'Include header file for HIME.dll. 
              'Download here: http://www.devotechs.com/HIMEDownloads.html
              #INCLUDE "HIME.inc"
              
              FUNCTION PBMAIN()
                  LOCAL i           AS LONG       
                  LOCAL password$, plain$, cipher$
                 '===============================================
                  '==== Encrypt data with AES in CBC mode
                  '===============================================
              
                  password$=LSET$("super secret password",32)
                  KILL "C:\Temp\testfile.crypt"
                  OPEN "C:\Temp\testfile.txt" FOR BINARY ACCESS READ AS #1
                  OPEN "C:\Temp\testfile.crypt" FOR BINARY ACCESS WRITE AS #2
                      
                      GET$ #1, LOF(#1), plain$
                      
                              'Store plaintext in register 1. Plaintext can have any length
                      hi_PutReg plain$   , 1
                              'Store encryption key in register 2. Key must be exactly 16, 24 or 32 bytes long
                      hi_PutReg password$, 2   
                              'Set an empty IV in register 3. HIME will create an IV itself
                      hi_PutReg ""       , 3
                              'Encrypt plaintext. Register 4 contains ciphertext
                      hi_Encrypt_AES_CBC 1, 2, 3, 4     
                  
                      cipher$ = hi_GetReg(4)  'Get ciphertext from HIME register 4 ..
                      PUT$ #2, cipher$        '.. and save it to file
                  CLOSE #2
                  CLOSE #1
              
                  
                  '===============================================
                  '==== Decrypt data with AES in CBC mode
                  '===============================================
                  KILL "C:\Temp\testfile2.txt"                                                                                  
                  OPEN "C:\Temp\testfile.crypt" FOR BINARY ACCESS READ AS #1
                  OPEN "C:\Temp\testfile2.txt" FOR BINARY ACCESS WRITE AS #2
                  
                      GET$ #1, LOF(#1), cipher$
                      
                              'Store ciphertext in register 1.
                      hi_PutReg cipher$  , 1
                              'Store encryption key in register 2. Key must be exactly 16, 24 or 32 bytes long
                      hi_PutReg password$, 2   
                              'Decrypt ciphertext
                      i = hi_Decrypt_AES_CBC(1, 2, 3)   'Register 3 contains decrypted ciphertext (= plaintext)    
                      IF i <> 0 THEN 
                          MSGBOX "'hi_Decrypt_AES_CBC' returned an error!"
                      END IF     
                  
                      plain$ = hi_GetReg(3)  'Get plaintext from HIME register 3 ..
                      PUT$ #2, plain$        '.. and save it to file
                  CLOSE #2
                  CLOSE #1
                                                                                                        
              END FUNCTION
              Kind regards
              Last edited by Eddy Van Esch; 25 Oct 2009, 04:00 AM.
              Eddy

              Comment


              • #8
                If you don't want your passphrase to be limited to the fixed AES key lengths of 16, 24 or 32 bytes, just hash the passphrase.
                For example by using SHA-256 like this:
                Code:
                    password$ = "This is a very long string to be used as AES password. Can be as long as you want!"
                    hi_PutReg password$, 1
                            'Calculate SHA-256 Hash value
                    hi_Hash_SHA_256 1, 2     'Register 2 contains hash value (32 bytes)
                    password$ = hi_GetReg(2)
                Kind regards
                Eddy

                Comment


                • #9
                  Great! Thanks!

                  How can processing of very large files?
                  Is the following implementation correct?

                  Code:
                  %BUFFER_LEN = 1000000
                  
                  FUNCTION PBMAIN () AS LONG
                  LOCAL password$, plain$, cipher$
                  LOCAL remainder AS LONG
                      password$=LSET$("super secret password",32)
                          [SIZE="3"][B]'Store encryption key in register 2. Key must be exactly 16, 24 or 32 bytes long
                      hi_PutReg password$, 2   
                          'Set an empty IV in register 3. HIME will create an IV itself
                      hi_PutReg ""       , 3[/B][/SIZE]
                      OPEN "C:\Temp\testfile.txt" FOR BINARY ACCESS READ AS #1
                      OPEN "C:\Temp\testfile.crypt" FOR BINARY ACCESS WRITE AS #2
                          remainder = LOF(#1)
                          WHILE remainder > 0
                              IF ( remainder ) > %BUFFER_LEN THEN
                                  GET$ #1, %BUFFER_LEN, plain$
                                  remainder = remainder - %BUFFER_LEN
                              ELSE
                                  GET$ #1, remainder, plain$
                                  remainder = 0
                              END IF
                                  [SIZE="3"][B]'Store plaintext in register 1. Plaintext can have any length
                              hi_PutReg plain$   , 1
                                  'Encrypt plaintext. Register 4 contains ciphertext
                              hi_Encrypt_AES_CBC 1, 2, 3, 4
                                  'Get ciphertext from HIME register 4 ..
                              cipher$ = hi_GetReg(4)[/B][/SIZE]
                              PUT$ #2, cipher$
                          WEND
                      CLOSE
                  END FUNCTION
                  Or, must be effected refresher of the key?

                  Code:
                  %BUFFER_LEN = 1000000
                  
                  FUNCTION PBMAIN () AS LONG
                  LOCAL password$, plain$, cipher$
                  LOCAL remainder AS LONG
                      password$=LSET$("super secret password",32)
                      OPEN "C:\Temp\testfile.txt" FOR BINARY ACCESS READ AS #1
                      OPEN "C:\Temp\testfile.crypt" FOR BINARY ACCESS WRITE AS #2
                          remainder = LOF(#1)
                          WHILE remainder > 0
                              IF ( remainder ) > %BUFFER_LEN THEN
                                  GET$ #1, %BUFFER_LEN, plain$
                                  remainder = remainder - %BUFFER_LEN
                              ELSE
                                  GET$ #1, remainder, plain$
                                  remainder = 0
                              END IF
                                  [SIZE="3"][B]'Store encryption key in register 2. Key must be exactly 16, 24 or 32 bytes long
                              hi_PutReg password$, 2   
                                  'Set an empty IV in register 3. HIME will create an IV itself
                              hi_PutReg ""       , 3
                                  'Store plaintext in register 1. Plaintext can have any length
                              hi_PutReg plain$   , 1
                                  'Encrypt plaintext. Register 4 contains ciphertext
                              hi_Encrypt_AES_CBC 1, 2, 3, 4
                                  'Get ciphertext from HIME register 4 ..
                              cipher$ = hi_GetReg(4)[/B][/SIZE]
                              PUT$ #2, cipher$
                          WEND
                      CLOSE
                  END FUNCTION

                  Comment


                  • #10
                    Bernhard,
                    Your first program is good. As long as the registers 2 and 3 (password and IV) are not overwritten, you do not have to refresh them. HIME does not change their contents.

                    PS. Instead of
                    Code:
                            cipher$ = hi_GetReg(4)  'Get ciphertext from HIME register 4 ..
                            PUT$ #2, cipher$        '.. and save it to file
                    You can also write:
                    Code:
                            PUT$ #2, hi_GetReg(4)  'Get ciphertext from HIME register 4 ..
                    Kind regards
                    Last edited by Eddy Van Esch; 26 Oct 2009, 04:12 AM.
                    Eddy

                    Comment


                    • #11
                      Must set initialization vector only once?

                      Code:
                      [B]    hi_PutReg password$, 2
                          hi_PutReg ""       , 3    'IV... HIME will create an IV itself[/B]
                          open file1
                              encrypt file1
                          close file1
                          open file2
                              encrypt file2
                          close file2
                      Or, must it always reset the initialization-vector?

                      Code:
                      [B]    hi_PutReg password$, 2
                          hi_PutReg ""       , 3    'IV 1... HIME will create an 1. IV itself[/B]
                          open file1
                              encrypt file1
                          close file1
                      [B]    hi_PutReg ""       , 3    'IV 2... HIME will create an 2. IV itself ???[/B]
                          open file2
                              encrypt file2
                          close file2

                      Comment


                      • #12
                        As long as the register contents that contains the IV (can be empty) is not overwritten, you do not have to set it again, as in your first code snippet.

                        Kind regards
                        Eddy

                        Comment


                        • #13
                          How the IV is formed? By password?

                          Comment


                          • #14
                            Originally posted by Bernhard Fomm View Post
                            How the IV is formed? By password?
                            No. The requirements of an IV (Initial Vector) are very little. It only has to be as long as the block size of the cipher used. For AES, this is 16 bytes.
                            That's it. It is good if the bytes are (pseudo)random but not required. The IV does not have to be kept secret. Most of the time the IV is sent along with the ciphertext, because it is needed for decryption of the ciphertext.
                            hi_Encrypt_AES_CBC attaches the IV to the ciphertext automatically.
                            If you do not provide an IV to HIME, and keep the IV register empty, HIME generates a random series of bytes to serve as IV.

                            Kind regards
                            Eddy

                            Comment

                            Working...
                            X