joverbey / oaccrefac

1 stars 1 forks source link

Unsupported construct in FEAL4 #63

Closed acalvert closed 8 years ago

acalvert commented 8 years ago

When strip mining this loop:

for (uint32_t guessK0 = 0; guessK0 < 0xFFFFFFFFL; guessK0++) {
    uint32_t guessK4 = 0;
    uint32_t guessK5 = 0;
    for (int32_t c = 0; c < numPlain; c++) {
      uint32_t plainLeft0 = leftHalf(plain0[c]);
      uint32_t plainRight0 = rightHalf(plain0[c]);
      uint32_t cipherLeft0 = leftHalf(cipher0[c]);
      uint32_t cipherRight0 = rightHalf(cipher0[c]);
      uint32_t tempy0 = fBox(cipherRight0 ^ guessK0) ^ cipherLeft0;
      if (guessK4 == 0) {
        guessK4 = tempy0 ^ plainLeft0;
        guessK5 = tempy0 ^ cipherRight0 ^ plainRight0;
      } else if (((tempy0 ^ plainLeft0) != guessK4)
               || ((tempy0 ^ cipherRight0 ^ plainRight0) != guessK5)) {
        guessK4 = 0;
        guessK5 = 0;
        break;
      }
    }
    if (guessK4 != 0) {
      crackedSubkey0 = guessK0;
      crackedSubkey4 = guessK4;
      crackedSubkey5 = guessK5;
      setGuess = true;
    }
  }

we get an error stating that dependences cannot be analyzed due to an unsupported construct, and it points to the condition on the else-if: ((tempy0 ^ plainLeft0) != guessK4) || ((tempy0 ^ cipherRight0 ^ plainRight0) != guessK5) Maybe we are intentionally not supporting the ^ operator or something, but it seems that this should be analyzable since it is simply a bunch of variable reads.

acalvert commented 8 years ago

I'm not really sure why, but this isn't happening anymore