Exemplo n.º 1
0
		internal void SetSymmetricKey(byte[] xteakey)
		{
			if (xteakey == null || xteakey.Length != 16)
				throw new NetException("Bad symmetric key length (" + xteakey.Length + ") must be 16!");
			m_symEncKeyBytes = xteakey;
			m_symmetricKey = new int[4];
			m_symmetricKey[0] = BitConverter.ToInt32(xteakey, 0);
			m_symmetricKey[1] = BitConverter.ToInt32(xteakey, 4);
			m_symmetricKey[2] = BitConverter.ToInt32(xteakey, 8);
			m_symmetricKey[3] = BitConverter.ToInt32(xteakey, 12);
			m_xtea = new XTEA(xteakey, 32);
		}
Exemplo n.º 2
0
 internal void SetSymmetricKey(byte[] xteakey)
 {
     if (xteakey == null || xteakey.Length != 16)
     {
         throw new NetException("Bad symmetric key length (" + xteakey.Length + ") must be 16!");
     }
     m_symEncKeyBytes  = xteakey;
     m_symmetricKey    = new int[4];
     m_symmetricKey[0] = BitConverter.ToInt32(xteakey, 0);
     m_symmetricKey[1] = BitConverter.ToInt32(xteakey, 4);
     m_symmetricKey[2] = BitConverter.ToInt32(xteakey, 8);
     m_symmetricKey[3] = BitConverter.ToInt32(xteakey, 12);
     m_xtea            = new XTEA(xteakey, 32);
 }