Debian Codegraph @

crypto_nP/montgomery25519/arm64-maa4-redmul/fe25519_nsquare.S

raw
1 #include "crypto_asm_property.h"
2 #include "crypto_asm_hidden.h"
3 // linker define fe25519_nsquare
4
5 /* Assembly for feedback field squaring */
6
7 .p2align 4
8 ASM_HIDDEN _CRYPTO_SHARED_NAMESPACE(fe25519_nsquare)
9 .globl _CRYPTO_SHARED_NAMESPACE(fe25519_nsquare)
10 ASM_HIDDEN CRYPTO_SHARED_NAMESPACE(fe25519_nsquare)
11 .globl CRYPTO_SHARED_NAMESPACE(fe25519_nsquare)
12
13 _CRYPTO_SHARED_NAMESPACE(fe25519_nsquare):
14 CRYPTO_SHARED_NAMESPACE(fe25519_nsquare):
15
16 sub sp, sp, #16
17 str x19, [sp, #0]
18
19 ldp x3, x4, [x1, #0]
20 ldp x5, x6, [x1, #16]
21
22 mov x17, #0x8000000000000000
23 mov x18, #38
24 mov x19, #19
25 .L:
26 mul x8, x4, x6
27 adds x8, x8, x8
28 cset x9, cs
29 mul x1, x5, x5
30 adds x8, x8, x1
31 adc x9, x9, xzr
32 umulh x1, x3, x6
33 adds x8, x8, x1
34 adc x9, x9, xzr
35 adds x8, x8, x1
36 adc x9, x9, xzr
37 umulh x1, x4, x5
38 adds x8, x8, x1
39 adc x9, x9, xzr
40 adds x10, x8, x1
41 adc x9, x9, xzr
42
43 mul x8, x18, x10
44 umulh x10, x18, x10
45 mul x9, x18, x9
46 add x9, x9, x10
47
48 mul x1, x3, x3
49 adds x8, x8, x1
50 adc x9, x9, xzr
51
52 mul x10, x5, x6
53 adds x10, x10, x10
54 cset x11, cs
55 umulh x1, x5, x5
56 adds x10, x10, x1
57 adc x11, x11, xzr
58 umulh x1, x4, x6
59 adds x10, x10, x1
60 adc x11, x11, xzr
61 adds x12, x10, x1
62 adc x11, x11, xzr
63
64 mul x10, x18, x12
65 umulh x12, x18, x12
66 mul x11, x18, x11
67 add x11, x11, x12
68
69 mul x1, x3, x4
70 adds x10, x10, x1
71 adc x11, x11, xzr
72 adds x10, x10, x1
73 adc x11, x11, xzr
74 umulh x1, x3, x3
75 adds x10, x10, x1
76 adcs x11, x11, xzr
77
78 mul x12, x6, x6
79 cset x13, cs
80 umulh x1, x5, x6
81 adds x12, x12, x1
82 adc x13, x13, xzr
83 adds x14, x12, x1
84 adc x13, x13, xzr
85
86 mul x12, x18, x14
87 umulh x14, x18, x14
88 mul x13, x18, x13
89 add x13, x13, x14
90
91 mul x1, x3, x5
92 adds x12, x12, x1
93 adc x13, x13, xzr
94 adds x12, x12, x1
95 adc x13, x13, xzr
96 mul x1, x4, x4
97 adds x12, x12, x1
98 adc x13, x13, xzr
99 umulh x1, x3, x4
100 adds x12, x12, x1
101 adc x13, x13, xzr
102 adds x12, x12, x1
103 adc x13, x13, xzr
104
105 umulh x15, x6, x6
106 mul x14, x18, x15
107 umulh x15, x18, x15
108
109 mul x1, x3, x6
110 adds x14, x14, x1
111 adc x15, x15, xzr
112 adds x14, x14, x1
113 adc x15, x15, xzr
114 mul x1, x4, x5
115 adds x14, x14, x1
116 adc x15, x15, xzr
117 adds x14, x14, x1
118 adc x15, x15, xzr
119 umulh x1, x3, x5
120 adds x14, x14, x1
121 adc x15, x15, xzr
122 adds x14, x14, x1
123 adc x15, x15, xzr
124 umulh x1, x4, x4
125 adds x14, x14, x1
126 adc x15, x15, xzr
127
128 adds x10, x10, x9
129 adcs x12, x12, x11
130 adcs x14, x14, x13
131 adc x15, x15, xzr
132
133 cmn x14, x14
134 adc x15, x15, x15
135 mul x15, x15, x19
136
137 bic x14, x14, x17
138 adds x3, x8, x15
139 adcs x4, x10, xzr
140 adcs x5, x12, xzr
141 adc x6, x14, xzr
142
143 sub x2, x2, #1
144 cmp x2, xzr
145 bne .L
146
147 stp x3, x4, [x0, #0]
148 stp x5, x6, [x0, #16]
149
150 ldr x19, [sp, #0]
151 add sp, sp, #16
152
153 ret
154 .section .note.GNU-stack,"",@progbits