Debian Codegraph @

crypto_nG/merged25519/amd64-maa4/fe25519_square.S

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