Basically, when de do: encrypt_round(aes_ft_tab,-96) encrypt_round(aes_ft_tab,-80) first encrypt_round produces results in R5,R6,R3,R4, and then moves R5->R1, R6->R2 for use in second one: #define encrypt_round(TAB,OFFSET) \ round(TAB,OFFSET,R1,R2,R3,R4,R5,R6,R7,R10,R5,R6,R3,R4) \ move_regs(R1,R2,R5,R6) But since we _always_ call them in pairs, we can just swap arguments in second one, eliminating move_regs! #define encrypt_round1(TAB,OFFSET) \ round(TAB,OFFSET,R1,R2,R3,R4,R5,R6,R7,R10,R5,R6,R3,R4) ^^^^^ ^^^^^ #define encrypt_round2(TAB,OFFSET) \ round(TAB,OFFSET,R5,R6,R3,R4,R1,R2,R7,R10,R1,R2,R3,R4) ^^^^^ ^^^^^ ... encrypt_round1(aes_ft_tab,-96) encrypt_round2(aes_ft_tab,-80) "encrypt_final" and "return" macros are changed accordingly. Of course same thing is done on decrypt path. Patch is not tested. -- vda