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
Denis Vlasenko <[email protected]> writes:
>
> Patch is not tested.
Which means it won't get applied.
-Andi
On Thursday 24 November 2005 19:23, Andi Kleen wrote:
> Denis Vlasenko <[email protected]> writes:
> >
> > Patch is not tested.
>
> Which means it won't get applied.
I have no 64bit machine here, sorry.
--
vda
Denis Vlasenko wrote:
[snip]
> #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)
> ^^^^^ ^^^^^
Won't work. You don't have "%sh", "%sl", "dh" (*) and "%dl" (*) as
registers.
(*) from %edi
--
Andreas Steinmetz SPAMmers use [email protected]