Skip to content

Instantly share code, notes, and snippets.

@lionaneesh
Last active June 17, 2019 12:00
Show Gist options
  • Save lionaneesh/0ede3222f07fc2dfc466689eb659abb1 to your computer and use it in GitHub Desktop.
Save lionaneesh/0ede3222f07fc2dfc466689eb659abb1 to your computer and use it in GitHub Desktop.
LED Round Main loop
AddKey(state, keyNibbles, 0);
for(i = 0; i < RN/4; i++){
int a;
for (j = 0; j < 4; j++) {
for (a = 0; a < 4; a++) {
printf("%2d ", state[j][a]);
}
printf("\n");
}
for(j = 0; j < 4; j++)
{
AddConstants(state, i*4+j);
// dump states
printf("AddConstants:\n");
int x;
for (x = 0; x < 4; x++) {
for (a = 0; a < 4; a++) {
printf("%2d ", state[x][a]);
}
printf("\n");
}
SubCell(state);
printf("SubCell:\n");
for (x = 0; x < 4; x++) {
for (a = 0; a < 4; a++) {
printf("%2d ", state[x][a]);
}
printf("\n");
}
ShiftRow(state);
printf("ShiftRow:\n");
for (x = 0; x < 4; x++) {
for (a = 0; a < 4; a++) {
printf("%2d ", state[x][a]);
}
printf("\n");
}
MixColumn(state);
printf("MixColumn:\n");
for (x = 0; x < 4; x++) {
for (a = 0; a < 4; a++) {
printf("%2d ", state[x][a]);
}
printf("\n");
}
}
AddKey(state, keyNibbles, i+1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment