Changeset 1714


Ignore:
Timestamp:
02/26/10 14:51:09 (11 years ago)
Author:
landlord
Message:

Simplify Sky IT post processing, thanks to furb3t

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/reader-videoguard2.c

    r1691 r1714  
    4444}
    4545
    46 //////  ====================================================================================
    47 //////  special thanks to an "italian forum" !!!!
    48 
     46unsigned short Nd$TabB001[0x4][0x20]= {
     47    { 0xEAF1,0x0237,0x29D0,0xBAD2,0xE9D3,0x8BAE,0x2D6D,0xCD1B,
     48        0x538D,0xDE6B,0xA634,0xF81A,0x18B5,0x5087,0x14EA,0x672E,
     49        0xF0FC,0x055E,0x62E5,0xB78F,0x5D09,0x0003,0xE4E8,0x2DCE,
     50        0x6BE0,0xAC4E,0xF485,0x6967,0xF28C,0x97A0,0x01EF,0x0100, },
     51    { 0xC539,0xF5B9,0x9099,0x013A,0xD4B9,0x6AB5,0xEA67,0x7EB4,
     52        0x6C30,0x4BF0,0xB810,0xB0B5,0xB76D,0xA751,0x1AE7,0x14CA,
     53        0x4F4F,0x1586,0x2608,0x10B1,0xE7E1,0x48BE,0x7DDD,0x5ECB,
     54        0xCFBF,0x323B,0x8B31,0xB131,0x0F1A,0x664B,0x0140,0x0100, },
     55    { 0x3C7D,0xBDC4,0xFEC7,0x26A6,0xB0A0,0x6E55,0xF710,0xF9BF,
     56        0x0023,0xE81F,0x41CA,0xBE32,0xB461,0xE92D,0xF1AF,0x409F,
     57        0xFC85,0xFE5B,0x7FCE,0x17F5,0x01AB,0x4A46,0xEB05,0xA251,
     58        0xDC6F,0xF0C0,0x10F0,0x1D51,0xEFAA,0xE9BF,0x0100,0x0100, },
     59    { 0x1819,0x0CAA,0x9067,0x607A,0x7576,0x1CBC,0xE51D,0xBF77,
     60        0x7EC6,0x839E,0xB695,0xF096,0xDC10,0xCB69,0x4654,0x8E68,
     61        0xD62D,0x4F1A,0x4227,0x92AC,0x9064,0x6BD1,0x1E75,0x2747,
     62        0x00DA,0xA6A6,0x6CF1,0xD151,0xBE56,0x3E33,0x0128,0x0100, },
     63};
     64
     65unsigned short Hash3[] = {0x0123,0x4567,0x89AB,0xCDEF,0xF861,0xCB52};
     66unsigned char Hash4[] = {0x0B,0x04,0x07,0x08,0x05,0x09,0x0B,0x0A,0x07,0x02,0x0A,0x05,0x04,0x08,0x0D,0x0F};
    4967
    5068static void postprocess_cw(unsigned char *cw, int nTableIdx)
    5169{
    52 
    53   if (!cw_is_valid(cw)) //if cw is all zero, keep it that way
    54     return;
    55 #if __BYTE_ORDER == __BIG_ENDIAN
    56   static unsigned char Tb1[0xC]={0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF,0xF8,0x61,0xCB,0x52};
    57   static unsigned char Tb2[0x540]= {
    58         0xEA,0xF1,0x02,0x37,0x29,0xD0,0xBA,0xD2,0xE9,0xD3,0x8B,0xAE,0x2D,0x6D,0xCD,0x1B,0x53,0x8D,0xDE,0x6B,0xA6,0x34,0xF8,0x1A,0x18,0xB5,0x50,0x87,0x14,0xEA,0x67,0x2E,
    59         0xF0,0xFC,0x05,0x5E,0x62,0xE5,0xB7,0x8F,0x5D,0x09,0x00,0x03,0xE4,0xE8,0x2D,0xCE,0x6B,0xE0,0xAC,0x4E,0xF4,0x85,0x69,0x67,0xF2,0x8C,0x97,0xA0,0x01,0xEF,0x01,0x00,
    60         0xC5,0x39,0xF5,0xB9,0x90,0x99,0x01,0x3A,0xD4,0xB9,0x6A,0xB5,0xEA,0x67,0x7E,0xB4,0x6C,0x30,0x4B,0xF0,0xB8,0x10,0xB0,0xB5,0xB7,0x6D,0xA7,0x51,0x1A,0xE7,0x14,0xCA,
    61         0x4F,0x4F,0x15,0x86,0x26,0x08,0x10,0xB1,0xE7,0xE1,0x48,0xBE,0x7D,0xDD,0x5E,0xCB,0xCF,0xBF,0x32,0x3B,0x8B,0x31,0xB1,0x31,0x0F,0x1A,0x66,0x4B,0x01,0x40,0x01,0x00,
    62         0x3C,0x7D,0xBD,0xC4,0xFE,0xC7,0x26,0xA6,0xB0,0xA0,0x6E,0x55,0xF7,0x10,0xF9,0xBF,0x00,0x23,0xE8,0x1F,0x41,0xCA,0xBE,0x32,0xB4,0x61,0xE9,0x2D,0xF1,0xAF,0x40,0x9F,
    63         0xFC,0x85,0xFE,0x5B,0x7F,0xCE,0x17,0xF5,0x01,0xAB,0x4A,0x46,0xEB,0x05,0xA2,0x51,0xDC,0x6F,0xF0,0xC0,0x10,0xF0,0x1D,0x51,0xEF,0xAA,0xE9,0xBF,0x01,0x00,0x01,0x00,
    64         0x18,0x19,0x0C,0xAA,0x90,0x67,0x60,0x7A,0x75,0x76,0x1C,0xBC,0xE5,0x1D,0xBF,0x77,0x7E,0xC6,0x83,0x9E,0xB6,0x95,0xF0,0x96,0xDC,0x10,0xCB,0x69,0x46,0x54,0x8E,0x68,
    65         0xD6,0x2D,0x4F,0x1A,0x42,0x27,0x92,0xAC,0x90,0x64,0x6B,0xD1,0x1E,0x75,0x27,0x47,0x00,0xDA,0xA6,0xA6,0x6C,0xF1,0xD1,0x51,0xBE,0x56,0x3E,0x33,0x01,0x28,0x01,0x00,
    66         0x40,0x91,0x09,0xED,0xD4,0x94,0x60,0x54,0x18,0x69,0x71,0xD5,0xB5,0x72,0x7B,0xF1,0xE9,0x25,0xEE,0x2D,0xEE,0xDE,0xA1,0x3C,0x66,0x13,0x9B,0xAB,0x12,0x2D,0x7A,0xE4,
    67         0x52,0x68,0xE6,0xC9,0x50,0xCB,0x79,0xA1,0xF2,0x12,0xA0,0x62,0x6B,0x48,0x70,0xB3,0xF6,0xB0,0x06,0xD5,0xF8,0xAB,0xEC,0xF5,0x62,0x55,0xED,0xD8,0x79,0xD2,0x29,0x0A,
    68         0xD3,0xCF,0x01,0x4E,0xAC,0xB3,0x8F,0x6B,0x0F,0x2C,0xA5,0xD8,0xE8,0xE0,0x86,0x3D,0x80,0xD5,0x57,0x05,0x65,0x8A,0x8B,0xC2,0xEE,0x46,0xD3,0xAE,0x01,0x99,0x01,0x00,
    69         0x4A,0x35,0xAB,0xE4,0xF9,0x76,0x93,0x5A,0xA8,0xA5,0xBA,0xE9,0x24,0xD0,0x71,0xAA,0xB3,0xFE,0x09,0x5E,0xAB,0x06,0x4C,0xD5,0x2F,0x0D,0x1A,0xCB,0x59,0xF3,0x4C,0x50,
    70         0xFD,0x27,0x0F,0x8E,0x19,0x1A,0xEE,0xE7,0x2F,0x49,0x3A,0x05,0x32,0x67,0x4F,0x88,0x38,0xAE,0xFC,0xE9,0x94,0x76,0x18,0xC6,0xF9,0x61,0x4E,0xF0,0x39,0xD0,0x42,0xE6,
    71         0xB7,0x47,0xE6,0x25,0xB6,0x8E,0x51,0x00,0xF9,0x2A,0x86,0xFE,0xE7,0x9B,0xEE,0x91,0x21,0xD5,0x4C,0x3C,0x68,0x3D,0x5A,0xD1,0x1B,0x49,0xF4,0x07,0x01,0x94,0x01,0x00,
    72         0x4B,0xF9,0xDC,0x0D,0x94,0x78,0x51,0x74,0xCB,0x4A,0x8A,0x89,0x4D,0x6A,0xFE,0xD8,0xF1,0x23,0xA8,0xCD,0xEE,0xE7,0xA6,0xD1,0xB7,0x63,0xF5,0xE2,0xE0,0x85,0x01,0xEF,
    73         0xE4,0x66,0x9F,0xA3,0x2F,0x68,0x21,0x90,0x42,0x3F,0x28,0x7F,0x7F,0x3F,0x09,0xF6,0x21,0x11,0xA9,0x63,0xD0,0xBB,0x67,0x4A,0xBA,0x72,0x45,0xF9,0xF1,0x86,0xB8,0xF5,
    74         0x00,0x10,0xD1,0xB9,0xB1,0x64,0x9E,0x87,0x1F,0x49,0x69,0x50,0x2D,0xBF,0x38,0xD3,0x2E,0xB0,0x3E,0x8E,0x91,0xE6,0xF6,0x88,0x7E,0x41,0x56,0x6E,0x01,0xB0,0x01,0x00,
    75         0x24,0xA1,0x73,0xD8,0xA0,0xC3,0xF7,0x1B,0xA0,0xA5,0x2A,0x06,0xBA,0x46,0xFE,0xC3,0xDD,0x4C,0x52,0xCC,0xF9,0xBC,0x3B,0x7E,0x38,0x12,0x06,0x66,0xB7,0x4B,0x40,0xF8,
    76         0x28,0xF2,0x7C,0x81,0xFC,0x92,0x6F,0xBD,0x53,0xD6,0x72,0xA3,0xBB,0xDF,0xB6,0xFC,0x9C,0xE5,0x23,0x31,0xD4,0xF6,0xC5,0xBB,0xE8,0xBB,0x66,0x76,0x02,0xD9,0x2F,0x0E,
    77         0xD0,0x09,0xD1,0x36,0xCD,0x09,0x75,0x51,0x18,0x26,0x9D,0x9B,0x63,0xEA,0xFC,0x63,0x68,0xCD,0x36,0x72,0xCB,0x95,0xD2,0x8E,0xF1,0xCD,0x20,0xCA,0x01,0x4C,0x01,0x00,
    78         0xE5,0x39,0x55,0xB7,0x98,0x9D,0x21,0xC4,0x46,0x3A,0xE6,0x8F,0xF8,0xB5,0xE5,0xC5,0x66,0x2B,0x35,0xBF,0x3C,0x50,0x01,0x31,0xF4,0xBF,0x38,0xB2,0x41,0xBC,0xB8,0x29,
    79         0x02,0xB7,0x6B,0x8F,0xA2,0x5C,0xAF,0xD2,0xD8,0x4A,0x22,0x43,0x53,0xEB,0xC6,0xC9,0x2E,0x14,0x18,0x1F,0x8F,0x96,0xDF,0x0E,0x0D,0x4C,0x30,0xF6,0xFF,0xE1,0x9D,0xDA,
    80         0x30,0xB6,0x77,0x7E,0xDA,0x3D,0xAF,0x77,0x20,0x5E,0xC9,0x0B,0x85,0x6B,0xB4,0x51,0x3B,0xCC,0x76,0xC2,0x8A,0xCF,0xDC,0xB1,0xA5,0xE5,0xDD,0x64,0x01,0x97,0x01,0x00,
    81         0xE7,0x51,0xB6,0x61,0x04,0x04,0xDB,0x4A,0xE9,0xDD,0xA4,0x00,0xAF,0x26,0x3F,0x5E,0x90,0x4B,0xA9,0x24,0x09,0xE0,0xE7,0x2B,0x82,0x5B,0x2C,0x50,0x6F,0xD0,0x0D,0x52,
    82         0x27,0x30,0xC2,0xBA,0x9E,0x44,0x58,0x15,0xFC,0x47,0xB2,0x1D,0x67,0xB8,0xF8,0xB9,0x04,0x7D,0xB0,0xAF,0x9F,0x14,0x74,0x1B,0x46,0x68,0xBE,0x54,0xDE,0x16,0xDB,0x14,
    83         0x7C,0xB7,0xF2,0xB8,0x06,0x83,0x76,0x2C,0x09,0xA0,0x95,0x07,0x7F,0x92,0x02,0x2C,0xBA,0x6A,0x7D,0x52,0x0A,0xF4,0x1B,0xC3,0xB4,0x6A,0xC4,0xFD,0x01,0xC2,0x01,0x00,
    84         0x76,0x11,0x66,0xF3,0xEE,0x87,0xED,0xD3,0xC5,0x59,0xEF,0xD4,0xDC,0x59,0xF8,0x6B,0x6D,0x1C,0x1C,0x85,0x9B,0xB1,0x33,0x73,0x76,0x3F,0x4E,0xBE,0x1B,0xF3,0x99,0xB5,
    85         0xD7,0x21,0x97,0x8F,0xCF,0x5C,0xAC,0x51,0x09,0x84,0x74,0x62,0x8F,0x0C,0x28,0x17,0x4A,0xD9,0xFD,0x41,0x66,0x78,0x7C,0x85,0xD3,0x30,0xC9,0xF8,0x1D,0x9A,0xC6,0x22,
    86         0x5A,0xE4,0xE1,0x6A,0x60,0xF6,0xFD,0x45,0x66,0x8C,0x29,0xD6,0x02,0x85,0x6B,0x92,0x92,0xC2,0x21,0xDE,0x45,0xE0,0xEF,0x3D,0x8B,0x0D,0x02,0xCD,0x01,0x98,0x01,0x00,
    87         0x9E,0x6D,0x4D,0x38,0xDE,0xF9,0xE6,0xF2,0xF7,0x2E,0xB3,0x13,0x14,0xF2,0x39,0x0A,0x2D,0x67,0xC7,0x1E,0xCB,0x69,0x7F,0x66,0xD3,0xCF,0x7F,0x8A,0x81,0xD9,0x9D,0xDE,
    88         0x85,0xE3,0x8F,0x29,0x36,0xEB,0xC9,0x68,0x36,0x96,0x59,0xF6,0x78,0x32,0xA7,0x8B,0xA1,0xD8,0xF5,0xCF,0xAB,0x64,0x64,0x6D,0x7A,0x2A,0xBA,0xF8,0xAA,0x87,0x41,0xC7,
    89         0x51,0x20,0xDE,0x78,0x73,0x8D,0xDC,0x1A,0x26,0x8D,0x5D,0xF8,0xED,0x69,0x1C,0x8A,0xBC,0x85,0x3D,0xCD,0xAE,0x30,0x0F,0x8D,0xEC,0x89,0x3A,0xBD,0x01,0x66,0x01,0x00,
    90         0xB8,0xBD,0x64,0x3B,0x74,0x8E,0xBD,0x63,0xEC,0x6F,0xE2,0x3A,0x94,0x93,0xDD,0x76,0x0A,0x62,0x77,0x4F,0xCD,0x68,0xA6,0x7A,0x9A,0x23,0xC8,0xA8,0xBD,0xE5,0x9D,0x1B,
    91         0x2B,0x86,0x8B,0x36,0x54,0x28,0x1D,0xFB,0xCD,0x1D,0x07,0x13,0x29,0xC2,0x8E,0x8E,0x52,0x07,0xA1,0x3F,0x60,0x05,0x4F,0x5E,0x52,0xE0,0xE7,0xC8,0x6D,0x1C,0x3E,0x34,
    92         0x58,0x1D,0x2B,0xFA,0x5E,0x1D,0xA8,0x91,0x10,0x69,0x1D,0xA4,0x39,0xA0,0xBE,0x45,0x5B,0x9A,0x73,0x33,0x6F,0x3E,0x86,0x37,0xA5,0x50,0xC9,0xE9,0x5C,0x6C,0x42,0xBA,
    93         0xA7,0x12,0xC3,0xEA,0x38,0x08,0x09,0x10,0xAA,0x4D,0x5B,0x25,0xAB,0xCD,0xE6,0x80,0x96,0xAD,0x2C,0xEC,0x8E,0xBB,0xA4,0x7D,0x16,0x90,0xE8,0xFB,0x01,0xC8,0x01,0x00,
    94         0x73,0xB9,0x82,0xBC,0x9E,0xBC,0xB1,0x30,0x0D,0xA5,0x86,0x17,0x9F,0x7B,0x97,0x66,0x20,0x5D,0x75,0x2D,0xB0,0x5C,0x2A,0x17,0xA7,0x5C,0x18,0xEF,0x83,0x39,0xFD,0x34,
    95         0x8D,0xA2,0x79,0x70,0xD0,0xB4,0x70,0xF1,0x37,0x65,0x73,0x80,0x7C,0xAF,0x57,0x0E,0x64,0x40,0xBC,0x44,0x07,0x43,0x2D,0x02,0x04,0x19,0xA2,0x40,0x21,0x13,0x1A,0xD4,
    96         0x1E,0xB5,0xBB,0xFF,0x39,0xB1,0x32,0x09,0x70,0x5F,0x15,0xF4,0xD7,0xAD,0x34,0x0B,0xC2,0xA6,0x25,0xCA,0xF4,0x12,0x95,0x70,0x0F,0x4F,0xE4,0xD5,0x16,0x14,0xE4,0x64,
    97         0x91,0x1A,0x0F,0x0E,0x07,0xDA,0xA9,0x29,0x23,0x79,0xD9,0x88,0x0A,0xA6,0x3B,0x57,0xBF,0x63,0x71,0xFB,0x72,0xD5,0x26,0xCE,0xB0,0xAF,0xCF,0x45,0x01,0x1B,0x01,0x00,
    98         0x99,0x99,0x98,0xFE,0xA1,0x08,0x65,0x88,0xF9,0x0B,0x45,0x54,0xFF,0x38,0x46,0x42,0x8F,0x5F,0x6C,0xC3,0x4E,0x8E,0xFF,0x7E,0x64,0xC2,0x50,0xCA,0x0E,0x7F,0xAD,0x7D,
    99         0x6A,0xAB,0x33,0xC1,0xE1,0xF4,0x61,0x65,0x78,0x94,0x83,0xB9,0x0A,0x0C,0x38,0xAF,0x58,0x03,0x18,0xC0,0xFA,0x36,0x59,0x2C,0x45,0x48,0xAB,0xB8,0x15,0x27,0xAE,0xE9,
    100   };
    101 #else
    102   static unsigned char Tb1[0xC]={0x23,0x01,0x67,0x45,0xAB,0x89,0xEF,0xCD,0x61,0xF8,0x52,0xCB};
    103   static unsigned char Tb2[0x540]= {
    104         0xF1,0xEA,0x37,0x02,0xD0,0x29,0xD2,0xBA,0xD3,0xE9,0xAE,0x8B,0x6D,0x2D,0x1B,0xCD,0x8D,0x53,0x6B,0xDE,0x34,0xA6,0x1A,0xF8,0xB5,0x18,0x87,0x50,0xEA,0x14,0x2E,0x67,
    105         0xFC,0xF0,0x5E,0x05,0xE5,0x62,0x8F,0xB7,0x09,0x5D,0x03,0x00,0xE8,0xE4,0xCE,0x2D,0xE0,0x6B,0x4E,0xAC,0x85,0xF4,0x67,0x69,0x8C,0xF2,0xA0,0x97,0xEF,0x01,0x00,0x01,
    106         0x39,0xC5,0xB9,0xF5,0x99,0x90,0x3A,0x01,0xB9,0xD4,0xB5,0x6A,0x67,0xEA,0xB4,0x7E,0x30,0x6C,0xF0,0x4B,0x10,0xB8,0xB5,0xB0,0x6D,0xB7,0x51,0xA7,0xE7,0x1A,0xCA,0x14,
    107         0x4F,0x4F,0x86,0x15,0x08,0x26,0xB1,0x10,0xE1,0xE7,0xBE,0x48,0xDD,0x7D,0xCB,0x5E,0xBF,0xCF,0x3B,0x32,0x31,0x8B,0x31,0xB1,0x1A,0x0F,0x4B,0x66,0x40,0x01,0x00,0x01,
    108         0x7D,0x3C,0xC4,0xBD,0xC7,0xFE,0xA6,0x26,0xA0,0xB0,0x55,0x6E,0x10,0xF7,0xBF,0xF9,0x23,0x00,0x1F,0xE8,0xCA,0x41,0x32,0xBE,0x61,0xB4,0x2D,0xE9,0xAF,0xF1,0x9F,0x40,
    109         0x85,0xFC,0x5B,0xFE,0xCE,0x7F,0xF5,0x17,0xAB,0x01,0x46,0x4A,0x05,0xEB,0x51,0xA2,0x6F,0xDC,0xC0,0xF0,0xF0,0x10,0x51,0x1D,0xAA,0xEF,0xBF,0xE9,0x00,0x01,0x00,0x01,
    110         0x19,0x18,0xAA,0x0C,0x67,0x90,0x7A,0x60,0x76,0x75,0xBC,0x1C,0x1D,0xE5,0x77,0xBF,0xC6,0x7E,0x9E,0x83,0x95,0xB6,0x96,0xF0,0x10,0xDC,0x69,0xCB,0x54,0x46,0x68,0x8E,
    111         0x2D,0xD6,0x1A,0x4F,0x27,0x42,0xAC,0x92,0x64,0x90,0xD1,0x6B,0x75,0x1E,0x47,0x27,0xDA,0x00,0xA6,0xA6,0xF1,0x6C,0x51,0xD1,0x56,0xBE,0x33,0x3E,0x28,0x01,0x00,0x01,
    112         0x91,0x40,0xED,0x09,0x94,0xD4,0x54,0x60,0x69,0x18,0xD5,0x71,0x72,0xB5,0xF1,0x7B,0x25,0xE9,0x2D,0xEE,0xDE,0xEE,0x3C,0xA1,0x13,0x66,0xAB,0x9B,0x2D,0x12,0xE4,0x7A,
    113         0x68,0x52,0xC9,0xE6,0xCB,0x50,0xA1,0x79,0x12,0xF2,0x62,0xA0,0x48,0x6B,0xB3,0x70,0xB0,0xF6,0xD5,0x06,0xAB,0xF8,0xF5,0xEC,0x55,0x62,0xD8,0xED,0xD2,0x79,0x0A,0x29,
    114         0xCF,0xD3,0x4E,0x01,0xB3,0xAC,0x6B,0x8F,0x2C,0x0F,0xD8,0xA5,0xE0,0xE8,0x3D,0x86,0xD5,0x80,0x05,0x57,0x8A,0x65,0xC2,0x8B,0x46,0xEE,0xAE,0xD3,0x99,0x01,0x00,0x01,
    115         0x35,0x4A,0xE4,0xAB,0x76,0xF9,0x5A,0x93,0xA5,0xA8,0xE9,0xBA,0xD0,0x24,0xAA,0x71,0xFE,0xB3,0x5E,0x09,0x06,0xAB,0xD5,0x4C,0x0D,0x2F,0xCB,0x1A,0xF3,0x59,0x50,0x4C,
    116         0x27,0xFD,0x8E,0x0F,0x1A,0x19,0xE7,0xEE,0x49,0x2F,0x05,0x3A,0x67,0x32,0x88,0x4F,0xAE,0x38,0xE9,0xFC,0x76,0x94,0xC6,0x18,0x61,0xF9,0xF0,0x4E,0xD0,0x39,0xE6,0x42,
    117         0x47,0xB7,0x25,0xE6,0x8E,0xB6,0x00,0x51,0x2A,0xF9,0xFE,0x86,0x9B,0xE7,0x91,0xEE,0xD5,0x21,0x3C,0x4C,0x3D,0x68,0xD1,0x5A,0x49,0x1B,0x07,0xF4,0x94,0x01,0x00,0x01,
    118         0xF9,0x4B,0x0D,0xDC,0x78,0x94,0x74,0x51,0x4A,0xCB,0x89,0x8A,0x6A,0x4D,0xD8,0xFE,0x23,0xF1,0xCD,0xA8,0xE7,0xEE,0xD1,0xA6,0x63,0xB7,0xE2,0xF5,0x85,0xE0,0xEF,0x01,
    119         0x66,0xE4,0xA3,0x9F,0x68,0x2F,0x90,0x21,0x3F,0x42,0x7F,0x28,0x3F,0x7F,0xF6,0x09,0x11,0x21,0x63,0xA9,0xBB,0xD0,0x4A,0x67,0x72,0xBA,0xF9,0x45,0x86,0xF1,0xF5,0xB8,
    120         0x10,0x00,0xB9,0xD1,0x64,0xB1,0x87,0x9E,0x49,0x1F,0x50,0x69,0xBF,0x2D,0xD3,0x38,0xB0,0x2E,0x8E,0x3E,0xE6,0x91,0x88,0xF6,0x41,0x7E,0x6E,0x56,0xB0,0x01,0x00,0x01,
    121         0xA1,0x24,0xD8,0x73,0xC3,0xA0,0x1B,0xF7,0xA5,0xA0,0x06,0x2A,0x46,0xBA,0xC3,0xFE,0x4C,0xDD,0xCC,0x52,0xBC,0xF9,0x7E,0x3B,0x12,0x38,0x66,0x06,0x4B,0xB7,0xF8,0x40,
    122         0xF2,0x28,0x81,0x7C,0x92,0xFC,0xBD,0x6F,0xD6,0x53,0xA3,0x72,0xDF,0xBB,0xFC,0xB6,0xE5,0x9C,0x31,0x23,0xF6,0xD4,0xBB,0xC5,0xBB,0xE8,0x76,0x66,0xD9,0x02,0x0E,0x2F,
    123         0x09,0xD0,0x36,0xD1,0x09,0xCD,0x51,0x75,0x26,0x18,0x9B,0x9D,0xEA,0x63,0x63,0xFC,0xCD,0x68,0x72,0x36,0x95,0xCB,0x8E,0xD2,0xCD,0xF1,0xCA,0x20,0x4C,0x01,0x00,0x01,
    124         0x39,0xE5,0xB7,0x55,0x9D,0x98,0xC4,0x21,0x3A,0x46,0x8F,0xE6,0xB5,0xF8,0xC5,0xE5,0x2B,0x66,0xBF,0x35,0x50,0x3C,0x31,0x01,0xBF,0xF4,0xB2,0x38,0xBC,0x41,0x29,0xB8,
    125         0xB7,0x02,0x8F,0x6B,0x5C,0xA2,0xD2,0xAF,0x4A,0xD8,0x43,0x22,0xEB,0x53,0xC9,0xC6,0x14,0x2E,0x1F,0x18,0x96,0x8F,0x0E,0xDF,0x4C,0x0D,0xF6,0x30,0xE1,0xFF,0xDA,0x9D,
    126         0xB6,0x30,0x7E,0x77,0x3D,0xDA,0x77,0xAF,0x5E,0x20,0x0B,0xC9,0x6B,0x85,0x51,0xB4,0xCC,0x3B,0xC2,0x76,0xCF,0x8A,0xB1,0xDC,0xE5,0xA5,0x64,0xDD,0x97,0x01,0x00,0x01,
    127         0x51,0xE7,0x61,0xB6,0x04,0x04,0x4A,0xDB,0xDD,0xE9,0x00,0xA4,0x26,0xAF,0x5E,0x3F,0x4B,0x90,0x24,0xA9,0xE0,0x09,0x2B,0xE7,0x5B,0x82,0x50,0x2C,0xD0,0x6F,0x52,0x0D,
    128         0x30,0x27,0xBA,0xC2,0x44,0x9E,0x15,0x58,0x47,0xFC,0x1D,0xB2,0xB8,0x67,0xB9,0xF8,0x7D,0x04,0xAF,0xB0,0x14,0x9F,0x1B,0x74,0x68,0x46,0x54,0xBE,0x16,0xDE,0x14,0xDB,
    129         0xB7,0x7C,0xB8,0xF2,0x83,0x06,0x2C,0x76,0xA0,0x09,0x07,0x95,0x92,0x7F,0x2C,0x02,0x6A,0xBA,0x52,0x7D,0xF4,0x0A,0xC3,0x1B,0x6A,0xB4,0xFD,0xC4,0xC2,0x01,0x00,0x01,
    130         0x11,0x76,0xF3,0x66,0x87,0xEE,0xD3,0xED,0x59,0xC5,0xD4,0xEF,0x59,0xDC,0x6B,0xF8,0x1C,0x6D,0x85,0x1C,0xB1,0x9B,0x73,0x33,0x3F,0x76,0xBE,0x4E,0xF3,0x1B,0xB5,0x99,
    131         0x21,0xD7,0x8F,0x97,0x5C,0xCF,0x51,0xAC,0x84,0x09,0x62,0x74,0x0C,0x8F,0x17,0x28,0xD9,0x4A,0x41,0xFD,0x78,0x66,0x85,0x7C,0x30,0xD3,0xF8,0xC9,0x9A,0x1D,0x22,0xC6,
    132         0xE4,0x5A,0x6A,0xE1,0xF6,0x60,0x45,0xFD,0x8C,0x66,0xD6,0x29,0x85,0x02,0x92,0x6B,0xC2,0x92,0xDE,0x21,0xE0,0x45,0x3D,0xEF,0x0D,0x8B,0xCD,0x02,0x98,0x01,0x00,0x01,
    133         0x6D,0x9E,0x38,0x4D,0xF9,0xDE,0xF2,0xE6,0x2E,0xF7,0x13,0xB3,0xF2,0x14,0x0A,0x39,0x67,0x2D,0x1E,0xC7,0x69,0xCB,0x66,0x7F,0xCF,0xD3,0x8A,0x7F,0xD9,0x81,0xDE,0x9D,
    134         0xE3,0x85,0x29,0x8F,0xEB,0x36,0x68,0xC9,0x96,0x36,0xF6,0x59,0x32,0x78,0x8B,0xA7,0xD8,0xA1,0xCF,0xF5,0x64,0xAB,0x6D,0x64,0x2A,0x7A,0xF8,0xBA,0x87,0xAA,0xC7,0x41,
    135         0x20,0x51,0x78,0xDE,0x8D,0x73,0x1A,0xDC,0x8D,0x26,0xF8,0x5D,0x69,0xED,0x8A,0x1C,0x85,0xBC,0xCD,0x3D,0x30,0xAE,0x8D,0x0F,0x89,0xEC,0xBD,0x3A,0x66,0x01,0x00,0x01,
    136         0xBD,0xB8,0x3B,0x64,0x8E,0x74,0x63,0xBD,0x6F,0xEC,0x3A,0xE2,0x93,0x94,0x76,0xDD,0x62,0x0A,0x4F,0x77,0x68,0xCD,0x7A,0xA6,0x23,0x9A,0xA8,0xC8,0xE5,0xBD,0x1B,0x9D,
    137         0x86,0x2B,0x36,0x8B,0x28,0x54,0xFB,0x1D,0x1D,0xCD,0x13,0x07,0xC2,0x29,0x8E,0x8E,0x07,0x52,0x3F,0xA1,0x05,0x60,0x5E,0x4F,0xE0,0x52,0xC8,0xE7,0x1C,0x6D,0x34,0x3E,
    138         0x1D,0x58,0xFA,0x2B,0x1D,0x5E,0x91,0xA8,0x69,0x10,0xA4,0x1D,0xA0,0x39,0x45,0xBE,0x9A,0x5B,0x33,0x73,0x3E,0x6F,0x37,0x86,0x50,0xA5,0xE9,0xC9,0x6C,0x5C,0xBA,0x42,
    139         0x12,0xA7,0xEA,0xC3,0x08,0x38,0x10,0x09,0x4D,0xAA,0x25,0x5B,0xCD,0xAB,0x80,0xE6,0xAD,0x96,0xEC,0x2C,0xBB,0x8E,0x7D,0xA4,0x90,0x16,0xFB,0xE8,0xC8,0x01,0x00,0x01,
    140         0xB9,0x73,0xBC,0x82,0xBC,0x9E,0x30,0xB1,0xA5,0x0D,0x17,0x86,0x7B,0x9F,0x66,0x97,0x5D,0x20,0x2D,0x75,0x5C,0xB0,0x17,0x2A,0x5C,0xA7,0xEF,0x18,0x39,0x83,0x34,0xFD,
    141         0xA2,0x8D,0x70,0x79,0xB4,0xD0,0xF1,0x70,0x65,0x37,0x80,0x73,0xAF,0x7C,0x0E,0x57,0x40,0x64,0x44,0xBC,0x43,0x07,0x02,0x2D,0x19,0x04,0x40,0xA2,0x13,0x21,0xD4,0x1A,
    142         0xB5,0x1E,0xFF,0xBB,0xB1,0x39,0x09,0x32,0x5F,0x70,0xF4,0x15,0xAD,0xD7,0x0B,0x34,0xA6,0xC2,0xCA,0x25,0x12,0xF4,0x70,0x95,0x4F,0x0F,0xD5,0xE4,0x14,0x16,0x64,0xE4,
    143         0x1A,0x91,0x0E,0x0F,0xDA,0x07,0x29,0xA9,0x79,0x23,0x88,0xD9,0xA6,0x0A,0x57,0x3B,0x63,0xBF,0xFB,0x71,0xD5,0x72,0xCE,0x26,0xAF,0xB0,0x45,0xCF,0x1B,0x01,0x00,0x01,
    144         0x99,0x99,0xFE,0x98,0x08,0xA1,0x88,0x65,0x0B,0xF9,0x54,0x45,0x38,0xFF,0x42,0x46,0x5F,0x8F,0xC3,0x6C,0x8E,0x4E,0x7E,0xFF,0xC2,0x64,0xCA,0x50,0x7F,0x0E,0x7D,0xAD,
    145         0xAB,0x6A,0xC1,0x33,0xF4,0xE1,0x65,0x61,0x94,0x78,0xB9,0x83,0x0C,0x0A,0xAF,0x38,0x03,0x58,0xC0,0x18,0x36,0xFA,0x2C,0x59,0x48,0x45,0xB8,0xAB,0x27,0x15,0xE9,0xAE,
    146 
    147   };
    148 #endif
    149   unsigned char tabletmp2[0x10] = {0x0B,0x04,0x07,0x08,0x05,0x09,0x0B,0x0A,0x07,0x02,0x0A,0x05,0x04,0x08,0x0D,0x0F};
    150   unsigned char table40[0x40];
    151   unsigned char Hash48[0x48];
    152   unsigned char Hash14[0x14];
    153   unsigned char counter=0,counter2=0;
    154   int tmp1;
    155   int h,j,k,l,m = 0;
    156   int i;
    157 
    158 
    159   memset(Hash48,0,0x48);
    160   for (i = 0; i < 8; i++)
    161     Hash48[i] = cw[i];
    162   Hash48[8]=0x80;
    163 
    164 
    165   memcpy(table40,&Tb2[nTableIdx*0x40],0x40);
    166 
    167   for(i = 0; i < 12; i++) Hash14[i] = Tb1[i];
    168 
    169   int k1 = *((short*) &Hash14);  int k2 = *((short*) &Hash14+1);  int k3 = *((short*) &Hash14+2);
    170   int k4 = *((short*) &Hash14+3);  int k5 = *((short*) &Hash14+4);  int k6 = *((short*) &Hash14+5);
    171   for (m = 0; m < 2; m++) {
    172     int loop;
    173     for (loop = 0; loop < 0x24; loop++) {
    174       h=((Hash48[(loop<<1) +1]<<8)+Hash48[loop<<1])&0xFFFF;
    175       if(m)
    176         tmp1 = (((k2 & k4) | ((~k4) & k3)) & 0xFFFF);
    177       else
    178         tmp1 = (((k2 & k3) | ((~k2) & k4)) & 0xFFFF);
    179       if((counter & 1))
    180         k = *(((short *) table40)+(counter>>1))>>8;
    181       else
    182         k = *(((short *) table40)+(counter>>1));
    183       l = k1;  j = k2;
    184       k1 = k2;  k2 = k3;  k3 = k4;  k4 = k5;  k5 = k6;
    185       k6 = ((tmp1 + l + h + (k & 0xFF)) & 0xFFFF);
    186       tmp1 = tabletmp2[counter2];
    187       k6 = ((((k6 << tmp1) | (k6 >> (0x10 - tmp1))) + j) & 0xFFFF);
    188       counter2++;
    189       if(counter2 == 0x10) counter2 = 0;
    190       counter++;
    191       if(counter == 0x40) counter = 0;
    192     }
    193   }
    194 
    195 //#if __BYTE_ORDER != __BIG_ENDIAN
    196   cw[0] = (k1 + *((short *)&Hash14)) & 0xFF;
    197   cw[1] = (k1 + *((short *)&Hash14))>>8;
    198   cw[2] = (k2 + *((short *)&Hash14+1)) & 0xFF;
     70    unsigned short hk[8],i,j,m=0;
     71    for (i = 0; i < 6; i++) hk[2+i]=Hash3[i];
     72    for (i = 0; i < 2; i++) {
     73        for (j = 0; j < 0x48; j+=2) {
     74            if (i)
     75                hk[0]=((hk[3] & hk[5]) | ((~hk[5]) & hk[4]));
     76            else
     77                hk[0]=((hk[3] & hk[4]) | ((~hk[3]) & hk[5]));
     78            if (j<8)
     79                hk[0]=(hk[0]+((cw[j +1]<<8) | cw[j]));
     80            if(j==8) hk[0]=(hk[0]+0x80);
     81            hk[0]=(hk[0]+hk[2] + (0xFF & Nd$TabB001[nTableIdx][m>>1] >> ((m&1)<<3))) ;
     82            hk[1] = hk[2];
     83            hk[2] = hk[3];
     84            hk[3] = hk[4];
     85            hk[4] = hk[5];
     86            hk[5] = hk[6];
     87            hk[6] = hk[7];
     88            hk[7] = hk[2]+
     89                        (((hk[0] << Hash4[m&0xF]) | (hk[0] >> (0x10 - Hash4[m&0xF]))));
     90            m=(m+1)&0x3F;
     91        }
     92    }
     93    for (i = 0; i < 6; i++)
     94        hk[2+i]+=Hash3[i];
     95    for (i = 0; i < 7; i++)
     96        cw[i]=hk[2+(i>>1)]>>((i&1)<<3);
    19997  cw[3] = (cw[0] + cw[1] + cw[2]) & 0xFF;
    200   cw[4] = (k3 + *((short *)&Hash14+2)) & 0xFF;
    201   cw[5] = (k3 + *((short *)&Hash14+2))>>8;
    202   cw[6] = (k4 + *((short *)&Hash14+3)) & 0xFF;
    20398  cw[7] = (cw[4] + cw[5] + cw[6]) & 0xFF;
    204 /*#else
    205   cw[0] = (k1 + *((short *)&Hash14))>>8;
    206   cw[1] = (k1 + *((short *)&Hash14)) & 0xFF;
    207   cw[2] = (k2 + *((short *)&Hash14+1))>>8;
    208   cw[3] = (cw[0] + cw[1] + cw[2]) & 0xFF;
    209   cw[4] = (k3 + *((short *)&Hash14+2))>>8;
    210   cw[5] = (k3 + *((short *)&Hash14+2)) & 0xFF;
    211   cw[6] = (k4 + *((short *)&Hash14+3))>>8;
    212   cw[7] = (cw[4] + cw[5] + cw[6]) & 0xFF;
    213 #endif*/
    214 
    215   cs_ddump (cw, 8, "Postprocessed DW:");
    216 }
    217 
    218 
    219 //////  ====================================================================================
     99
     100
    220101
    221102static void swap_lb (unsigned char *buff, int len)
Note: See TracChangeset for help on using the changeset viewer.