Skip to content

Commit

Permalink
sm4: ppc64x, use VSBOX #249
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored Sep 23, 2024
1 parent 18b117f commit c305795
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 2 additions & 5 deletions sm4/aesni_macros_ppc64x.s
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
LXVD2X (baseAddrReg)(offsetReg), REVERSE_WORDS; \
MOVD $0x50, offsetReg; \
LXVD2X (baseAddrReg)(offsetReg), NIBBLE_MASK; \
MOVD $0x60, offsetReg; \
LXVD2X (baseAddrReg)(offsetReg), INVERSE_SHIFT_ROWS; \
MOVD $0x70, offsetReg; \
LXVD2X (baseAddrReg)(offsetReg), M1L; \
MOVD $0x80, offsetReg; \
Expand Down Expand Up @@ -124,9 +122,8 @@
// - z: 128 bits temp register
#define SM4_SBOX(x, y, z) \
AFFINE_TRANSFORM(M1L, M1H, V_FOUR, x, y, z); \
VPERM x, x, INVERSE_SHIFT_ROWS, x; \
VCIPHERLAST x, NIBBLE_MASK, x; \
AFFINE_TRANSFORM_NOTX(M2L, M2H, V_FOUR, x, y, z)
VSBOX x, x; \
AFFINE_TRANSFORM(M2L, M2H, V_FOUR, x, y, z)

// SM4 TAO L1 function
// parameters:
Expand Down
4 changes: 0 additions & 4 deletions sm4/asm_ppc64x.s
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ TEXT ·expandKeyAsm(SB),NOSPLIT,$0
LXVD2X (R4)(R0), REVERSE_WORDS
MOVD $16, R3
LXVD2X (R4)(R3), NIBBLE_MASK
MOVD $32, R3
LXVD2X (R4)(R3), INVERSE_SHIFT_ROWS
MOVD $48, R3
LXVD2X (R4)(R3), M1L
MOVD $64, R3
Expand Down Expand Up @@ -151,8 +149,6 @@ TEXT ·encryptBlockAsm(SB),NOSPLIT,$0
LXVD2X (R4)(R0), REVERSE_WORDS
MOVD $16, R3
LXVD2X (R4)(R3), NIBBLE_MASK
MOVD $32, R3
LXVD2X (R4)(R3), INVERSE_SHIFT_ROWS
MOVD $48, R3
LXVD2X (R4)(R3), M1L
MOVD $64, R3
Expand Down

0 comments on commit c305795

Please sign in to comment.