Debian Codegraph @

crypto_nP/montgomery25519/amd64-avx2-hey10l-maa5/fe25519_nsquare.S

raw
1 #include "crypto_asm_property.h"
2 #include "crypto_asm_hidden.h"
3 // linker define fe25519_nsquare
4 // linker use mask51
5
6 /* Assembly for feedback field squaring. */
7
8 #define mask51 CRYPTO_SHARED_NAMESPACE(mask51)
9
10 .p2align 5
11 ASM_HIDDEN _CRYPTO_SHARED_NAMESPACE(fe25519_nsquare)
12 .globl _CRYPTO_SHARED_NAMESPACE(fe25519_nsquare)
13 ASM_HIDDEN CRYPTO_SHARED_NAMESPACE(fe25519_nsquare)
14 .globl CRYPTO_SHARED_NAMESPACE(fe25519_nsquare)
15 _CRYPTO_SHARED_NAMESPACE(fe25519_nsquare):
16 CRYPTO_SHARED_NAMESPACE(fe25519_nsquare):
17
18 movq %rsp,%r11
19 andq $-32,%rsp
20 subq $64,%rsp
21
22 movq %r11,0(%rsp)
23 movq %r12,8(%rsp)
24 movq %r13,16(%rsp)
25 movq %r14,24(%rsp)
26 movq %r15,32(%rsp)
27 movq %rbx,40(%rsp)
28 movq %rbp,48(%rsp)
29
30 movq 0(%rsi),%r8
31 movq 8(%rsi),%r9
32 movq 16(%rsi),%r10
33 movq 24(%rsi),%r11
34 movq 32(%rsi),%r12
35
36 movq %r10,16(%rdi)
37 movq %r11,24(%rdi)
38 movq %r12,32(%rdi)
39
40 movq %rdx,%rsi
41
42 .L:
43
44 subq $1,%rsi
45
46 movq %r8,%rax
47 mulq %r8
48 movq %rax,%r10
49 movq %rdx,%r11
50
51 shlq $1,%r8
52 movq %r8,%rax
53 mulq %r9
54 movq %rax,%r12
55 movq %rdx,%r13
56
57 movq %r8,%rax
58 mulq 16(%rdi)
59 movq %rax,%r14
60 movq %rdx,%r15
61
62 movq %r9,%rax
63 mulq %r9
64 addq %rax,%r14
65 adcq %rdx,%r15
66
67 movq %r8,%rax
68 mulq 24(%rdi)
69 movq %rax,%rbx
70 movq %rdx,%rbp
71
72 shlq $1,%r9
73 movq %r9,%rax
74 mulq 16(%rdi)
75 addq %rax,%rbx
76 adcq %rdx,%rbp
77
78 movq %r8,%rax
79 mulq 32(%rdi)
80 movq %rax,%r8
81 movq %rdx,%rcx
82
83 movq %r9,%rax
84 mulq 24(%rdi)
85 addq %rax,%r8
86 adcq %rdx,%rcx
87
88 movq 16(%rdi),%rax
89 mulq %rax
90 addq %rax,%r8
91 adcq %rdx,%rcx
92
93 shld $13,%r8,%rcx
94
95 imul $19,24(%rdi),%rax
96 mulq 24(%rdi)
97 addq %rax,%r12
98 adcq %rdx,%r13
99
100 imul $19,32(%rdi),%rax
101 movq %rax,56(%rsp)
102 mulq 32(%rdi)
103 addq %rax,%rbx
104 adcq %rdx,%rbp
105
106 shld $13,%rbx,%rbp
107
108 imul $19,32(%rdi),%rax
109 mulq %r9
110 addq %rax,%r10
111 adcq %rdx,%r11
112
113 imul $38,24(%rdi),%rax
114 mulq 16(%rdi)
115 addq %rax,%r10
116 adcq %rdx,%r11
117
118 shld $13,%r10,%r11
119
120 imul $38,32(%rdi),%rax
121 mulq 24(%rdi)
122 addq %rax,%r14
123 adcq %rdx,%r15
124
125 shld $13,%r14,%r15
126
127 movq 56(%rsp),%rax
128 shlq $1,%rax
129 mulq 16(%rdi)
130 addq %rax,%r12
131 adcq %rdx,%r13
132
133 shld $13,%r12,%r13
134
135 imul $19,%rcx,%rcx
136
137 movq mask51(%rip),%rdx
138
139 andq %rdx,%r10
140 andq %rdx,%r12
141 andq %rdx,%r14
142 andq %rdx,%rbx
143 andq %rdx,%r8
144
145 addq %rcx,%r10
146 addq %r11,%r12
147 addq %r13,%r14
148 addq %r15,%rbx
149 addq %rbp,%r8
150
151 movq %r10,%rax
152 shrq $51,%rax
153 addq %r12,%rax
154 andq %rdx,%r10
155
156 movq %rax,%r9
157 shrq $51,%rax
158 addq %r14,%rax
159 andq %rdx,%r9
160
161 movq %rax,%r14
162 shrq $51,%rax
163 addq %rbx,%rax
164 andq %rdx,%r14
165
166 movq %r14,16(%rdi)
167
168 movq %rax,%rbx
169 shrq $51,%rax
170 addq %r8,%rax
171 andq %rdx,%rbx
172
173 movq %rbx,24(%rdi)
174
175 movq %rax,%r8
176 shrq $51,%r8
177 imul $19,%r8,%r8
178 addq %r10,%r8
179 andq %rdx,%rax
180
181 movq %rax,32(%rdi)
182
183 cmpq $0,%rsi
184
185 jne .L
186
187 movq %r8,0(%rdi)
188 movq %r9,8(%rdi)
189
190 movq 0(%rsp),%r11
191 movq 8(%rsp),%r12
192 movq 16(%rsp),%r13
193 movq 24(%rsp),%r14
194 movq 32(%rsp),%r15
195 movq 40(%rsp),%rbx
196 movq 48(%rsp),%rbp
197
198 movq %r11,%rsp
199
200 ret
201 .section .note.GNU-stack,"",@progbits