Esempio n. 1
0
void CAesAlg::_AesDecode32(UInt32 *dest, const UInt32 *src, const UInt32 *w, unsigned numRounds2)
{
	UInt32 s[4];
	UInt32 m[4];
	w += numRounds2 * 8;
	s[0] = src[0] ^ w[0];
	s[1] = src[1] ^ w[1];
	s[2] = src[2] ^ w[2];
	s[3] = src[3] ^ w[3];
	for (;;)
	{
		w -= 8;
		HD16(m, s, 4);
		if (--numRounds2 == 0)
			break;
		HD16(s, m, 0);
	}
	FD4(0); FD4(1); FD4(2); FD4(3);
}
Esempio n. 2
0
File: Aes.c Progetto: Dabil/puNES
static void Aes_Decode(const UInt32 *w, UInt32 *dest, const UInt32 *src)
{
  UInt32 s[4];
  UInt32 m[4];
  UInt32 numRounds2 = w[0];
  w += 4 + numRounds2 * 8;
  s[0] = src[0] ^ w[0];
  s[1] = src[1] ^ w[1];
  s[2] = src[2] ^ w[2];
  s[3] = src[3] ^ w[3];
  for (;;)
  {
    w -= 8;
    HD16(m, s, 4);
    if (--numRounds2 == 0)
      break;
    HD16(s, m, 0);
  }
  FD4(0); FD4(1); FD4(2); FD4(3);
}