SHARE
TWEET

Untitled

a guest May 11th, 2019 209 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. Subtract(unsigned int result,unsigned int result1,unsigned int result2,unsigned int result3,unsigned char temp[10]) {
  6. unsigned int p,i,c,s,l,o;
  7. unsigned char parint[10] ={0x7f,0xff,0xff,0xff,0x80,0x00,0x00,0x00},parinttemp[10];
  8.  
  9. for(i=0;i<10;i++) {
  10.     parinttemp[i] = 0x00;
  11. }
  12.  
  13. //parinttemp[8] = 0x01;
  14.  
  15. p = result&0xff;
  16. parinttemp[7] = p&0xff;
  17. p = result&0xff00;
  18. parinttemp[6] = (p&0xff00)>>8;
  19.  
  20. p = result1&0xff;
  21. parinttemp[5] = p&0xff;
  22. p = result1&0xff00;
  23. parinttemp[4] = (p&0xff00)>>8;
  24.  
  25. p = result2&0xff;
  26. parinttemp[3] = p&0xff;
  27. p = result2&0xff00;
  28. parinttemp[2] = (p&0xff00)>>8;
  29.  
  30. p = result3&0xff;
  31. parinttemp[1] = p&0xff;
  32. p = result3&0xff00;
  33. parinttemp[0] = (p&0xff00)>>8;
  34.  
  35.  
  36. for(p=0,i=1;p<8;p++) {
  37.         s = (parint[p]<<8)&0x0000ff00;
  38.         l = (parinttemp[p]<<8)&0x0000ff00;
  39.         c = s-l;
  40.         parinttemp[p] = (c>>8)&0xff;
  41.         //if(p == 7 && ((c>>16)&0xff) > 0) parinttemp[7] = parinttemp[7] + 2;
  42.         if(((c>>24)&0xff) == 0xff && parinttemp[p-1] > 0 && (p > 0)) parinttemp[p-1] = parinttemp[p-1] - 1;
  43.         if(((c>>24)&0xff) == 0xff && parinttemp[p-1] == 0&& (p > 0)){
  44.             parinttemp[p-1] = parinttemp[p-1] - 1;
  45.             if(parinttemp[p-2] > 0 && (p > 1)) parinttemp[p-2] = parinttemp[p-2] - 1;
  46.             if(parinttemp[p-2] == 0 && (p > 1)){
  47.                 parinttemp[p-2] = parinttemp[p-2] - 1;
  48.                 if(parinttemp[p-3] > 0 && (p > 2)) parinttemp[p-3] = parinttemp[p-3] - 1;
  49.                 if(parinttemp[p-3] == 0 && (p > 2)){
  50.                     parinttemp[p-3] = parinttemp[p-3] - 1;
  51.                     if(parinttemp[p-4] > 0 && (p > 3)) parinttemp[p-4] = parinttemp[p-4] - 1;
  52.                     if(parinttemp[p-4] == 0 && (p > 3)){
  53.                         parinttemp[p-4] = parinttemp[p-4] - 1;
  54.                         if(parinttemp[p-5] > 0 && (p > 4)) parinttemp[p-5] = parinttemp[p-5] - 1;
  55.                         if(parinttemp[p-5] == 0 && (p > 4)){
  56.                             parinttemp[p-5] = parinttemp[p-5] - 1;
  57.                             if(parinttemp[p-6] > 0 && (p > 5)) parinttemp[p-6] = parinttemp[p-6] - 1;
  58.                             if(parinttemp[p-6] == 0 && (p > 5)){
  59.                                 parinttemp[p-6] = parinttemp[p-6] - 1;
  60.                                 if(parinttemp[p-7] > 0 && (p > 6)) parinttemp[p-7] = parinttemp[p-7] - 1;
  61.                                 if(parinttemp[p-7] == 0 && (p > 6)){
  62.                                     parinttemp[p-7] = parinttemp[p-7] - 1;
  63.  
  64.                                 }
  65.                             }
  66.                         }
  67.                     }
  68.                 }
  69.             }
  70.         }
  71.  
  72.  
  73. }
  74. //for(i=0;i<8;i++) {
  75.  //   printf("%2X,",parinttemp[i]);
  76. //}
  77.  
  78. memcpy(temp,parinttemp,sizeof(unsigned char) * 8);
  79.  
  80. }
  81.  
  82.  
  83.  
  84.  
  85.  
  86. Strip(unsigned char temp[10]) {
  87. unsigned int p,i,c,s,l;
  88. unsigned char parint[10] ={0x7f,0xff,0xff,0xff,0x80,0x00,0x00,0x00},parinttemp[10];
  89.  
  90. for(i=0;i<10;i++) {
  91.     parinttemp[i] = 0x00;
  92. }
  93.  
  94.  
  95. parinttemp[0] = temp[0];
  96. parinttemp[1] = temp[1];
  97. parinttemp[2] = temp[2];
  98. parinttemp[3] = temp[3];
  99. parinttemp[4] = temp[4];
  100. parinttemp[5] = temp[5];
  101. parinttemp[6] = temp[6];
  102. parinttemp[7] = temp[7];
  103.  
  104.  
  105.  
  106. for(p=0,i=1;p<8;p++) {
  107.         s = (parint[p]<<8)&0x0000ff00;
  108.         l = (parinttemp[p]<<8)&0x0000ff00;
  109.         c = s-l;
  110.         parinttemp[p] = (c>>8)&0xff;
  111.         //if(p == 7 && ((c>>8)&0xff) > 0) parinttemp[7] = parinttemp[7] - 1;
  112.         if(((c>>24)&0xff) == 0xff && parinttemp[p-1] > 0 && (p > 0)) parinttemp[p-1] = parinttemp[p-1] - 1;
  113.         if(((c>>24)&0xff) == 0xff && parinttemp[p-1] == 0&& (p > 0)){
  114.             parinttemp[p-1] = parinttemp[p-1] - 1;
  115.             if(parinttemp[p-2] > 0 && (p > 1)) parinttemp[p-2] = parinttemp[p-2] - 1;
  116.             if(parinttemp[p-2] == 0 && (p > 1)){
  117.                 parinttemp[p-2] = parinttemp[p-2] - 1;
  118.                 if(parinttemp[p-3] > 0 && (p > 2)) parinttemp[p-3] = parinttemp[p-3] - 1;
  119.                 if(parinttemp[p-3] == 0 && (p > 2)){
  120.                     parinttemp[p-3] = parinttemp[p-3] - 1;
  121.                     if(parinttemp[p-4] > 0 && (p > 3)) parinttemp[p-4] = parinttemp[p-4] - 1;
  122.                     if(parinttemp[p-4] == 0 && (p > 3)){
  123.                         parinttemp[p-4] = parinttemp[p-4] - 1;
  124.                         if(parinttemp[p-5] > 0 && (p > 4)) parinttemp[p-5] = parinttemp[p-5] - 1;
  125.                         if(parinttemp[p-5] == 0 && (p > 4)){
  126.                             parinttemp[p-5] = parinttemp[p-5] - 1;
  127.                             if(parinttemp[p-6] > 0 && (p > 5)) parinttemp[p-6] = parinttemp[p-6] - 1;
  128.                             if(parinttemp[p-6] == 0 && (p > 5)){
  129.                                 parinttemp[p-6] = parinttemp[p-6] - 1;
  130.                                 if(parinttemp[p-7] > 0 && (p > 6)) parinttemp[p-7] = parinttemp[p-7] - 1;
  131.                                 if(parinttemp[p-7] == 0 && (p > 6)){
  132.                                     parinttemp[p-7] = parinttemp[p-7] - 1;
  133.  
  134.                                 }
  135.                             }
  136.                         }
  137.                     }
  138.                 }
  139.             }
  140.         }
  141.  
  142.  
  143.  
  144. }
  145.  
  146. memcpy(temp,parinttemp,sizeof(unsigned char) * 8);
  147.  
  148. }
  149.  
  150.  
  151.  
  152.  
  153. int main()
  154. {
  155.     unsigned int i,p,c,count,s,t,potty=0,carry,l,a,b,w;
  156.     unsigned int di,dp,dl,ds;
  157.     unsigned int parnum=0,rota=0,xor=0;
  158.     unsigned char parint[10] ={0x7f,0xff,0xff,0xff,0x80,0x00,0x00,0x00};
  159.     unsigned char parinttemp[10],parinttemp1[10],temp[10],temp1[10],temp2[10];
  160.     unsigned int sbox[16][16],sboxblank[16][16],Rcon[]={0x01000000,0x02000000,0x04000000,0x08000000,0x10000000,0x20000000,
  161.                   0x40000000,0x80000000,0x1b000000,0x36000000,0x6c000000,0xd8000000,
  162.                   0xab000000,0x4d000000,0x9a000000};
  163.     unsigned int result,key[16] ={0x41,0x41,0x41,0x42,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41},u[16*12];
  164.     unsigned int convert[70],convert1[70],convert2[70];
  165.     //add input to value in box
  166.     unsigned int store[258],storevalue[258],value1[258];
  167.         unsigned char storepar[258][10];
  168.     unsigned int value[258][10];
  169.  
  170.  
  171.     //((result+(potty/2))
  172.     unsigned int sstore[256],sstorevalue[256],svalue1[256];
  173.      unsigned char sstorepar[256][10];
  174.       unsigned int svalue[256][10];
  175.  
  176.  //((result-(potty*2))
  177.     unsigned int tstore[258],tstorevalue[258],tvalue1[258];
  178.     unsigned char tstorepar[258][10];
  179.      unsigned int tvalue[258][10];
  180.  
  181.     unsigned int decode[12][10];
  182.     unsigned int cost[258][3];
  183.     unsigned char sboxaes[16][16] = {
  184. 0x63,0x7C,0x77,0x7B,0xF2,0x6B,0x6F,0xC5,0x30,0x01,0x67,0x2B,0xFE,0xD7,0xAB,0x76,
  185. 0xCA,0x82,0xC9,0x7D,0xFA,0x59,0x47,0xF0,0xAD,0xD4,0xA2,0xAF,0x9C,0xA4,0x72,0xC0,
  186. 0xB7,0xFD,0x93,0x26,0x36,0x3F,0xF7,0xCC,0x34,0xA5,0xE5,0xF1,0x71,0xD8,0x31,0x15,
  187. 0x04,0xC7,0x23,0xC3,0x18,0x96,0x05,0x9A,0x07,0x12,0x80,0xE2,0xEB,0x27,0xB2,0x75,
  188. 0x09,0x83,0x2C,0x1A,0x1B,0x6E,0x5A,0xA0,0x52,0x3B,0xD6,0xB3,0x29,0xE3,0x2F,0x84,
  189. 0x53,0xD1,0x00,0xED,0x20,0xFC,0xB1,0x5B,0x6A,0xCB,0xBE,0x39,0x4A,0x4C,0x58,0xCF,
  190. 0xD0,0xEF,0xAA,0xFB,0x43,0x4D,0x33,0x85,0x45,0xF9,0x02,0x7F,0x50,0x3C,0x9F,0xA8,
  191. 0x51,0xA3,0x40,0x8F,0x92,0x9D,0x38,0xF5,0xBC,0xB6,0xDA,0x21,0x10,0xFF,0xF3,0xD2,
  192. 0xCD,0x0C,0x13,0xEC,0x5F,0x97,0x44,0x17,0xC4,0xA7,0x7E,0x3D,0x64,0x5D,0x19,0x73,
  193. 0x60,0x81,0x4F,0xDC,0x22,0x2A,0x90,0x88,0x46,0xEE,0xB8,0x14,0xDE,0x5E,0x0B,0xDB,
  194. 0xE0,0x32,0x3A,0x0A,0x49,0x06,0x24,0x5C,0xC2,0xD3,0xAC,0x62,0x91,0x95,0xE4,0x79,
  195. 0xE7,0xC8,0x37,0x6D,0x8D,0xD5,0x4E,0xA9,0x6C,0x56,0xF4,0xEA,0x65,0x7A,0xAE,0x08,
  196. 0xBA,0x78,0x25,0x2E,0x1C,0xA6,0xB4,0xC6,0xE8,0xDD,0x74,0x1F,0x4B,0xBD,0x8B,0x8A,
  197. 0x70,0x3E,0xB5,0x66,0x48,0x03,0xF6,0x0E,0x61,0x35,0x57,0xB9,0x86,0xC1,0x1D,0x9E,
  198. 0xE1,0xF8,0x98,0x11,0x69,0xD9,0x8E,0x94,0x9B,0x1E,0x87,0xE9,0xCE,0x55,0x28,0xDF,
  199. 0x8C,0xA1,0x89,0x0D,0xBF,0xE6,0x42,0x68,0x41,0x99,0x2D,0x0F,0xB0,0x54,0xBB,0x16};
  200. for(i=0;i<10;i++) {
  201.        parinttemp[i] = 0x00;
  202.        parinttemp1[i] = 0x00;
  203.        temp[i] = 0x00;
  204.        temp1[i] = 0x00;
  205. }
  206. for(l=0;l<16;l++) {
  207. for(i=0;i<16;i++) {
  208.         sboxblank[i][l] = 0x00;
  209. }
  210. }
  211.  
  212.  
  213.  
  214.  
  215. //might use this latter
  216.     for(i=0;i<=255;i++)
  217.     {
  218.         parnum=parnum+i;
  219.     }
  220.     printf("%x\n",parnum);
  221.     for(i=0,t=0;i<16;t++) {
  222.         sbox[i][t] = 0x00;
  223.         sbox[i][t] = parnum-(sboxaes[i][t]&0xff);
  224.        // printf("%X,",sbox[i][t]);
  225.         if(t > 16) {
  226.             t=0;
  227.             i++;
  228.         }
  229.     }
  230.  
  231. //memset
  232. for(i=0;i<=256;i++) {
  233.     store[i]= 0x00;
  234.     storevalue[i] = 0x00;
  235.     value1[i] = 0x00;
  236.     cost[i][0] = 0x00;
  237.     cost[i][1] = 0x00;
  238.  
  239. }
  240.  
  241. //memset
  242. for(i=0;i<=0xff;i++) {
  243.     for(p=0;p<10;p++) {
  244.         value[i][p] = 0x00;
  245. }}
  246.  
  247. for(potty=0;potty<=0xff;potty++) {
  248. result = 0x00;
  249. result = ( unsigned int)sboxaes[(potty >> 4) & 0x0000000F][potty & 0x0000000F];
  250.     //maths function one, used to find dulpicates and convert
  251.     //if cmp statements into basic maths functions
  252.     // add minus times divide
  253.     s = potty+result;
  254.     store[potty] = s;
  255.     for(i=0;i<10;i++) {
  256.         temp[i] = 0x00;
  257.     }
  258.   Subtract(s,0,0,0 ,temp);
  259.     for(i=0;i<10;i++) {
  260.         storepar[potty][i] = temp[i];
  261.     }
  262.     value1[potty] = result;
  263.  
  264. }
  265.  
  266. printf("\n\n");
  267. for(i=0;i<=0xff;i++) {
  268.     count=0x00;
  269.     for(p=0;p<=0xff;p++) {
  270.         if(store[i] == store[p] && i != p) count++;
  271.     }
  272.     storevalue[i] = count;
  273.      if(count == 0x00) value[i][0] = 0x00;
  274.     if(count > 0) {
  275.         value[i][0] = i;
  276.         for(l=0;l<=count;l++) {
  277.             value[i][l+1] = value1[i];
  278.         }
  279.     }
  280. }
  281.  
  282.  
  283. for(i=0;i<=256;i++) {
  284.     sstore[i] = 0x00;
  285.     sstorevalue[i] = 0x00;
  286.     svalue1[i] = 0x00;
  287. }
  288. for(i=0;i<=0xff;i++) {
  289.     for(p=0;p<10;p++) {
  290.         svalue[i][p] = 0x00;
  291. }}
  292.  
  293. for(potty=0;potty<=0xff;potty++) {
  294. result = 0x00;
  295. result = (int)sboxaes[(potty >> 4) & 0x0000000F][potty & 0x0000000F];
  296.     s = ((result+potty)/2);
  297.     sstore[potty] = s;
  298.     for(i=0;i<10;i++) {
  299.         temp[i] = 0x00;
  300.     }
  301.     Subtract(s,0,0,0 ,temp);
  302.     for(i=0;i<10;i++) {
  303.         sstorepar[potty][i] = temp[i];
  304.     }
  305.     svalue1[potty] = result;
  306.  
  307. }
  308. printf("\n\n");
  309. for(i=0;i<=0xff;i++) {
  310.     count=0x00;
  311.     for(p=0;p<=0xff;p++) {
  312.         if(sstore[i] == sstore[p]  && i != p) count++;
  313.     }
  314.     sstorevalue[i] = count;
  315.      if(count == 0x00) svalue[i][0] = 0x00;
  316.     if(count > 0) {
  317.         svalue[i][0] = i;
  318.         for(l=0;l<=count;l++) {
  319.             svalue[i][l+1] = svalue1[i];
  320.         }
  321.     }
  322. }
  323.  
  324.  
  325.  
  326. for(i=0;i<=256;i++) {
  327.     tstore[i]= 0x00;
  328.     tstorevalue[i] = 0x00;
  329.     tvalue1[i] = 0x00;
  330. }
  331.  
  332.  
  333. for(i=0;i<=0xff;i++) {
  334.     for(p=0;p<10;p++) {
  335.         tvalue[i][p] = 0x00;
  336. }}
  337.  
  338. for(potty=0;potty<=0xff;potty++) {
  339. result = 0x00;
  340. result = (int)sboxaes[(potty >> 4) & 0x0000000F][potty & 0x0000000F];
  341.     s = ((0xff-result)/2);
  342.     tstore[potty] = s;
  343.     for(i=0;i<10;i++) {
  344.         temp[i] = 0x00;
  345.     }
  346.     Subtract(s,0,0,0 ,temp);
  347.     for(i=0;i<10;i++) {
  348.         tstorepar[potty][i] = temp[i];
  349.     }
  350.     tvalue1[potty] = result;
  351. }
  352. printf("\n\n");
  353. for(i=0;i<=0xff;i++) {
  354.     count=0x00;
  355.     for(p=0;p<=0xff;p++) {
  356.         if(tstore[i] == tstore[p] && i != p) count++;
  357.     }
  358.     tstorevalue[i] = count;
  359.     if(count == 0x00) tvalue[i][0] = 0x00;
  360.     if(count > 0) {
  361.         tvalue[i][0] = i;
  362.         for(l=0;l<=count;l++) {
  363.             tvalue[i][l+1] = tvalue1[i];
  364.         }
  365.     }
  366. }
  367.  
  368.  
  369.  
  370.  
  371. for(i=0;i<=0xff;i++) {
  372.     if( storevalue[i] != 0) {
  373.         cost[i][0] = store[i];
  374.         cost[i][1] = 0x01;
  375.  
  376.     }
  377.     if(storevalue[i] == 0) {
  378.         if(sstorevalue[i] != 0x00) {
  379.             cost[i][0] = sstore[i];
  380.             cost[i][1] = 0x02;
  381.  
  382.         }
  383.         if(sstorevalue[i] == 0x00) {
  384.             if(tstorevalue[i] != 0x00) {
  385.                 cost[i][0] = tstore[i];
  386.                 cost[i][1] = 0x03;
  387.  
  388.             }
  389.         }
  390.     }
  391.  
  392. }
  393.  
  394. for(i=0;i<=0xff;i++) {
  395.     printf("%X  %d  ==  %X\n",i,cost[i][1],cost[i][0]);
  396. }
  397.  
  398.  
  399.  
  400. //////////////
  401. /*
  402. aes subword functions loop it 12 times for 128bit
  403.  
  404. */
  405. potty = 0x25252727;
  406. a=potty;
  407. for(i=0;i<12;i++) {
  408.         result = (unsigned int)sboxaes[(potty >> 4) & 0x0000000F][potty & 0x0000000F];
  409.         result += (unsigned int)sboxaes[(potty >> 12) & 0x0000000F][(potty >> 8) & 0x0000000F] << 8;
  410.         result += (unsigned int)sboxaes[(potty >> 20) & 0x0000000F][(potty >> 16) & 0x0000000F] << 16;
  411.         result += (unsigned int)sboxaes[(potty>> 28) & 0x0000000F][(potty >> 24) & 0x0000000F] << 24;
  412. potty = result;
  413. }
  414. printf("\n%X ==  input\n",a);
  415. printf("\n%X ==  Hash\n",result);
  416.  
  417. //memset
  418. for(i=0;i<12;i++) {
  419.     for(s=0;s<10;s++) {
  420.         decode[i][s] = 0x00;
  421.     }
  422. }
  423.  
  424. //unsigned int bruteforce
  425. for(p=0;p<=0xff;p++) {
  426. for(l=0;l<=0xff;l++) {
  427.     for(s=0;s<=0xff;s++) {
  428.         for(i=0;i<=0xff;i++) {
  429.             di = i;
  430.             dl = l;
  431.             ds = s;
  432.             dp = p;
  433.  
  434.             for(b=0;b<12;b++) {
  435.            //patch a problem with the subtract function
  436.            cost[di][0] = cost[di][0] -1;
  437.            //subtract the sbox values from parnum and do it 12 times
  438.            //latter slect what data you want to select
  439.             Subtract(cost[di][0],cost[ds][0],cost[dl][0],cost[dp][0] ,temp);
  440.  
  441.             ///////////////////////////////*
  442.             /*
  443.                 strip out the parrellel data to leve the result
  444.                 and applie basic maths functions
  445.  
  446.             */
  447.             Strip(temp);
  448.  
  449.             c = temp[7]&0xff;
  450.             c = c + ((temp[6]&0xff)<<8);
  451.             if(cost[i][1] == 0x01) c = c - i;
  452.             if(cost[i][1] == 0x02) c = (c + i)/2;
  453.             if(cost[i][1] == 0x03) c = (0xff - c)/2;
  454.             decode[0][3] = c&0xff;
  455.  
  456.             c = temp[5]&0xff;
  457.             c = c + ((temp[4]&0xff)<<8);
  458.             if(cost[s][1] == 0x01) c = c - s;
  459.             if(cost[s][1] == 0x02) c = (c + s)/2;
  460.             if(cost[s][1] == 0x03) c = (0xff - c)/2;
  461.             decode[0][2] = c&0xff;
  462.  
  463.             c = temp[3]&0xff;
  464.             c = c + ((temp[2]&0xff)<<8);
  465.             if(cost[l][1] == 0x01) c = c - l;
  466.             if(cost[l][1] == 0x02) c = (c + l)/2;
  467.             if(cost[l][1] == 0x03) c = (0xff - c)/2;
  468.             decode[0][1] = c&0xff;
  469.  
  470.             c = temp[1]&0xff;
  471.             c = c + ((temp[0]&0xff)<<8);
  472.             if(cost[p][1] == 0x01) c = c - p;
  473.             if(cost[p][1] == 0x02) c = (c + p)/2;
  474.             if(cost[p][1] == 0x03) c = (0xff - c)/2;
  475.             decode[0][0] = c&0xff;
  476.  
  477.             di = decode[0][3];
  478.             dl = decode[0][1];
  479.             ds = decode[0][2];
  480.             dp = decode[0][0];
  481.  
  482.             }
  483.           //This well take awhile
  484.           //  if( decode[0][3] == (a&0xff) && decode[0][2] == ((a>>8)&0xff) && decode[0][1] == ((a>>24)&0xff) && decode[0][0] == ((a>>16)&0xff) ) {
  485.             ////////////
  486.           //quicker test
  487.             if( decode[0][3] == (a&0xff) && decode[0][2] == ((a>>8)&0xff) && decode[0][1] == ((a>>24)&0xff)) {
  488.             ////////////
  489.  
  490.                 printf("\n\n found run 0\n\n");
  491.                   printf(" = %2X,%2X,%2X,%2X",decode[0][0],decode[0][1],decode[0][2],decode[0][3]);
  492.                     printf("\n");
  493.                 exit(1);
  494.             }
  495.  
  496.  
  497.         }
  498.     }
  499. }
  500. }
  501.  
  502.  
  503.     Strip(temp);
  504.  
  505.  
  506. exit(1);
  507.  
  508.  
  509. printf("Rotate\n");
  510. w=0;
  511. for(i=0;i<=0xff;i++) {
  512.     c = ((i<<4) | (i>>12));
  513.     w=w+c;
  514.     //printf("%X value\n",w);
  515. }
  516.  
  517.     rota = 0xff800000;
  518.     xor = 0x7f0080;
  519. //printf("%X value\n",w);
  520.  
  521. printf("\n");
  522.  
  523.  
  524. for (i=0; i < 4; i++) {
  525. u[i] = ((key[4 * i]) << 24) | ((key[4 * i + 1]) << 16) |
  526.    ((key[4 * i + 2]) << 8) | ((key[4 * i + 3]));
  527. }
  528.  
  529. for (i = 0; i < 4; i++) {
  530. l = u[i];
  531. w = u[i];
  532. w = (rota-w);
  533. s = w+xor;
  534.  
  535. for(p=0;p<8;p++) {
  536.  
  537. printf("%X,",temp[p]);
  538. }
  539. printf("  ==  ");
  540. for(p=0;p<8;p++) {
  541.  
  542. printf("%X,",temp1[p]);
  543. }
  544. printf("  ==  ");
  545. for(p=0;p<8;p++) {
  546.  
  547. printf("%X,",temp2[p]);
  548. }
  549.  
  550. printf("\n");
  551. }
  552.  
  553. Strip(temp);
  554. for(p=0;p<8;p++) {
  555.  
  556. printf("%X,",temp[p]);
  557. }
  558.  
  559.  
  560. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top