# HG changeset patch # User michael # Date 1168808595 0 # Node ID b1ad10c8f3622063762fa5297fb249a934dda9d8 # Parent d36946d9907e61a6841e244736253d615969fed7 simplify diff -r d36946d9907e -r b1ad10c8f362 aes.c --- a/aes.c Sun Jan 14 19:58:41 2007 +0000 +++ b/aes.c Sun Jan 14 21:03:15 2007 +0000 @@ -158,7 +158,9 @@ memcpy(tk, key, KC*4); for(t= 0; t < (rounds+1)*4;) { - memcpy(a->round_key[0][t], tk, KC*4); + if(decrypt) memcpy(a->round_key[0 ][ t], tk, KC*4); + else memcpy(a->round_key[rounds][-t], tk, KC*4); + t+= KC; for(i = 0; i < 4; i++) @@ -179,11 +181,6 @@ a->round_key[i][0][j]= sbox[a->round_key[i][0][j]]; mix(a->round_key[i], dec_multbl); } - }else{ - for(i=0; i<(rounds+1)/2; i++){ - for(j=0; j<16; j++) - FFSWAP(int, a->round_key[i][0][j], a->round_key[rounds-i][0][j]); - } } return a;