Skip to content

Commit

Permalink
test VNAND
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored Sep 11, 2024
1 parent 6c62c14 commit 3491cb0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sm4/asm_ppc64x.s
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ GLOBL ·rcon(SB), RODATA, $192
AFFINE_TRANSFORM(M1L, M1H, V_FOUR, x, y, z); \
; \
VPERM x, x, INVERSE_SHIFT_ROWS, x; \
VCIPHERLAST NIBBLE_MASK, x, x; \
VCIPHERLAST x, NIBBLE_MASK, x; \
; \
AFFINE_TRANSFORM_N(M2L, M2H, V_FOUR, x, y, z)

Expand Down Expand Up @@ -181,6 +181,11 @@ TEXT ·expandKeyAsm(SB),NOSPLIT,$0
VSLDOI $4, V1, V1, V2
VSLDOI $4, V2, V2, V3

VNAND NIBBLE_MASK, REVERSE_WORDS, V5
STXVW4X V5, (R5)
VNAND REVERSE_WORDS, NIBBLE_MASK, V5
STXVW4X V5, (R6)
/*
ksLoop:
LXVW4X (R4), V4
SM4_EXPANDKEY_ROUND(V4, V7, V8, V9, V0, V1, V2, V3, V5)
Expand All @@ -198,7 +203,7 @@ ksLoop:
ADD $16, R4
ADD $-16, R6
BDNZ ksLoop

*/
RET

// func encryptBlocksAsm(xk *uint32, dst, src []byte, inst int)
Expand Down

0 comments on commit 3491cb0

Please sign in to comment.