void addkey(byte *State, byte *Roundkey)

{

int i;

byte KR[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

byte *KL = Roundkey;

byte *W0 = KL;

byte *W = W0;

printm(W0);

f0_round(W, C1);

byte *W1 = W;

for (i = 0; i <= 15; i++)

W1[i] = W[i] ^ KR[i];

printm(W1);


fe_round(W, C2);

byte *W2 = W;

for (i = 0; i <= 15; i++)

W2[i] = W[i] ^ W0[i];

printm(W2);


f0_round(W, C3);

byte *W3 = W;

for (i = 0; i <= 15; i++)

W1[i] = W[i] ^ W1[i];

printm(W3);


}


일단 라운드함수들의 리턴값은 *W임 그래서 주소값이 같아버리니 함수를 실행하면 같은 주소값으로 연결되있는 변수들의 값이 다바뀌어버려서 

재사용이불가능해져요 ㅠㅠ