Hey Collin,
I was running the built-in CPA attack on AES 128 using chipwhisperer 4.0.2 on the XMEGA target,
It exposed the key with the default power model (HW). However, changing to HD didn’t succeed to expose the key (still the built in implementation with the only change: leak_model = AES128_8bit( SBoxInOutDiff )
I am trying to make modifications in the C code of the aes implementation in the SubByte step in order to make the HD model to work successfully.
I saw in your folders different implementations of AES, and compiling the file in ‘victims\firmware\simpleserial-aes’ according to your guide, i saw that the files complied are from: ‘firmware\crypto\avrcryptolib\aes’.
the c code of the Subbyte step there is:
void aes_enc_lastround(aes_cipher_state_t* state,const aes_roundkey_t* k){
uint8_t i;
/* subBytes */
for(i=0; i<16; ++i){
state->s[i] = pgm_read_byte(aes_sbox+state->s[i]);
}
I’d like to make sure that i understood correctly:
a)‘pgm_read_byte(aes_sbox+state->s[i])’ the Sbox output
b) ‘state->s[i]’ the Sbox input
What changes should i apply to the c code to make this attack work on the HD between the Sbox input and Sbox output? Or is there another way you suggest to do that?
i’m stuck with it for a long time so i’d appreciate your help very much.
Thank you!