Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 
0003 #include <linux/linkage.h>
0004 #include <asm/assembler.h>
0005 
0006     .irp        b, 0, 1, 2, 3, 4, 5, 6, 7, 8
0007     .set        .Lv\b\().4s, \b
0008     .endr
0009 
0010     .macro      sm4e, rd, rn
0011     .inst       0xcec08400 | .L\rd | (.L\rn << 5)
0012     .endm
0013 
0014     /*
0015      * void sm4_ce_do_crypt(const u32 *rk, u32 *out, const u32 *in);
0016      */
0017     .text
0018 SYM_FUNC_START(sm4_ce_do_crypt)
0019     ld1     {v8.4s}, [x2]
0020     ld1     {v0.4s-v3.4s}, [x0], #64
0021 CPU_LE( rev32       v8.16b, v8.16b      )
0022     ld1     {v4.4s-v7.4s}, [x0]
0023     sm4e        v8.4s, v0.4s
0024     sm4e        v8.4s, v1.4s
0025     sm4e        v8.4s, v2.4s
0026     sm4e        v8.4s, v3.4s
0027     sm4e        v8.4s, v4.4s
0028     sm4e        v8.4s, v5.4s
0029     sm4e        v8.4s, v6.4s
0030     sm4e        v8.4s, v7.4s
0031     rev64       v8.4s, v8.4s
0032     ext     v8.16b, v8.16b, v8.16b, #8
0033 CPU_LE( rev32       v8.16b, v8.16b      )
0034     st1     {v8.4s}, [x1]
0035     ret
0036 SYM_FUNC_END(sm4_ce_do_crypt)