Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. static byte[] RCon_i(int inp) //количество раундов
  2.         {
  3.             byte[] arr_rci = new byte[inp];
  4.  
  5.             arr_rci[0] = 0x01;
  6.             for(int i=1;i<inp;i++)
  7.             {
  8.                 if(arr_rci[i-1] < 0x80)
  9.                 {
  10.                     arr_rci[i] = GF_Multp(arr_rci[i - 1], 2);
  11.                 }
  12.                 else if(arr_rci[i] >= 0x80)
  13.                 {
  14.                     arr_rci[i] = (byte)(GF_Multp(arr_rci[i - 1], 2) ^ 0x1b);
  15.                 }
  16.             }
  17.  
  18.             return arr_rci;
  19.         }
  20. static void Main(string[] args)
  21.         {
  22.             byte i = Convert.ToByte(Console.ReadLine());
  23.  
  24.             byte[] outp = new byte[i];
  25.             outp = RCon_i(i);
  26.  
  27.             for(int j=0;j<i;j++)
  28.             {
  29.                 Console.Write(outp[j] + " ");
  30.             }
  31.  
  32.             Console.ReadKey();
  33.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement