stoneharry

Untitled

Jun 16th, 2012
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1.     static const unsigned short hash_constant (0x7a0b);
  2.     Sha1Hash newone;
  3.     newone.UpdateBigNumbers (&m_sessionkey, NULL);
  4.     newone.UpdateData ((uint8*)&hash_constant, sizeof (hash_constant));
  5.     newone.Finalize();
  6.     const unsigned char* hashed_session_key (newone.GetDigest());
  7.  
  8.     const int size = sizeof(hashed_session_key);
  9.  
  10.     uint8 store[size];
  11.  
  12.     for (int i = 0; i < size; i++)
  13.     {
  14.         store[i] ^= hashed_session_key[i];
  15.     }
  16.     BigNumber result;
  17.     result.SetBinary(store, size);
  18.  
  19.     Log.Debug("Auth", "Result: \n %s", result);
Advertisement
Add Comment
Please, Sign In to add comment