diff --git a/powerpc64/p8/aes-decrypt-internal.asm b/powerpc64/p8/aes-decrypt-internal.asm index 1c33f2799feb18d95b6df86bfb7be5e4336a5223..1dc6662838ee00030f0c00487cdb9996698f326e 100644 --- a/powerpc64/p8/aes-decrypt-internal.asm +++ b/powerpc64/p8/aes-decrypt-internal.asm @@ -115,14 +115,14 @@ IF_LE(`OPN_XXXY(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') OPN_XXY(vxor, K, S0, S1, S2, S3, S4, S5, S6, S7) mtctr ROUNDS - li r10,0x10 + li r10,-0x10 .align 5 L8x_round_loop: lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK OPN_XXY(vncipher, ZERO, S0, S1, S2, S3, S4, S5, S6, S7) OPN_XXY(vxor, K, S0, S1, S2, S3, S4, S5, S6, S7) - addi r10,r10,0x10 + subi r10,r10,0x10 bdnz L8x_round_loop lxvd2x VSR(K),r10,KEYS @@ -176,14 +176,14 @@ IF_LE(`OPN_XXXY(vperm, SWAP_MASK, S0,S1,S2,S3)') OPN_XXY(vxor, K, S0, S1, S2, S3) mtctr ROUNDS - li r10,0x10 + li r10,-0x10 .align 5 L4x_round_loop: lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK OPN_XXY(vncipher, ZERO, S0, S1, S2, S3) OPN_XXY(vxor, K, S0, S1, S2, S3) - addi r10,r10,0x10 + subi r10,r10,0x10 bdnz L4x_round_loop lxvd2x VSR(K),r10,KEYS @@ -224,7 +224,7 @@ IF_LE(`vperm S0,S0,S0,SWAP_MASK vxor S1,S1,K mtctr ROUNDS - li r10,0x10 + li r10,-0x10 .align 5 L2x_round_loop: lxvd2x VSR(K),r10,KEYS @@ -233,7 +233,7 @@ L2x_round_loop: vncipher S1,S1,ZERO vxor S0,S0,K vxor S1,S1,K - addi r10,r10,0x10 + subi r10,r10,0x10 bdnz L2x_round_loop lxvd2x VSR(K),r10,KEYS @@ -267,14 +267,14 @@ IF_LE(`vperm S0,S0,S0,SWAP_MASK') vxor S0,S0,K mtctr ROUNDS - li r10,0x10 + li r10,-0x10 .align 5 L1x_round_loop: lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK vncipher S0,S0,ZERO vxor S0,S0,K - addi r10,r10,0x10 + subi r10,r10,0x10 bdnz L1x_round_loop lxvd2x VSR(K),r10,KEYS