Breaking AES pipelined on CW305

Hi,

I am trying to break the pipelined AES implementation on CW305 using the CW305_AES_pipelined demo. At the moment, I am encrypting one AES block at a time.

The modified leakage function in the demo uses the prev_ct and ct. From what I understood, prev_ct is the ciphertext after the 9th round and I obtain it from ct by performing:
inv_sr(inv_sbox(ct ^ last_rnd_key))

However, plugging this value in the modified leakage function provides incorrect key guess.

Could you please provide some information on how the value of prev_ct is obtained?

Regards,
Ali

Not quite. There are previous rounds and previous ciphertexts. Consider some arbitrary point in time, where block i is being encrypted prev_ct is the final AES ciphertext that was obtained when block i-1 was encrypted. In this leakage function:

def leakage(self, pt, ct, prev_ct, key, bnum):
    curr = inv_sbox(ct[bnum] ^ key[bnum])
    prev = inv_sbox(prev_ct[bnum] ^ key[bnum])
    return curr ^ prev

curr is the partial encryption result after round 9 for block i;
prev is the partial encryption result after round 9 for block i-1.

As for the attack not working – try more traces.

Thanks for your reply.

From your explanation, I changed the leakage model and it worked.

Thanks,
Ali