diff options
Diffstat (limited to 'nacl/crypto_scalarmult/curve25519/athlon/fromdouble.s')
-rw-r--r-- | nacl/crypto_scalarmult/curve25519/athlon/fromdouble.s | 195 |
1 files changed, 195 insertions, 0 deletions
diff --git a/nacl/crypto_scalarmult/curve25519/athlon/fromdouble.s b/nacl/crypto_scalarmult/curve25519/athlon/fromdouble.s new file mode 100644 index 00000000..221ca35f --- /dev/null +++ b/nacl/crypto_scalarmult/curve25519/athlon/fromdouble.s | |||
@@ -0,0 +1,195 @@ | |||
1 | .text | ||
2 | .p2align 5 | ||
3 | .globl _crypto_scalarmult_curve25519_athlon_fromdouble | ||
4 | .globl crypto_scalarmult_curve25519_athlon_fromdouble | ||
5 | _crypto_scalarmult_curve25519_athlon_fromdouble: | ||
6 | crypto_scalarmult_curve25519_athlon_fromdouble: | ||
7 | mov %esp,%eax | ||
8 | and $31,%eax | ||
9 | add $192,%eax | ||
10 | sub %eax,%esp | ||
11 | movl %ebp,0(%esp) | ||
12 | movl 8(%esp,%eax),%ecx | ||
13 | fldl 0(%ecx) | ||
14 | faddl crypto_scalarmult_curve25519_athlon_out0offset | ||
15 | fstpl 96(%esp) | ||
16 | fldl 8(%ecx) | ||
17 | faddl crypto_scalarmult_curve25519_athlon_out1offset | ||
18 | fstpl 104(%esp) | ||
19 | fldl 16(%ecx) | ||
20 | faddl crypto_scalarmult_curve25519_athlon_out2offset | ||
21 | fstpl 112(%esp) | ||
22 | fldl 24(%ecx) | ||
23 | faddl crypto_scalarmult_curve25519_athlon_out3offset | ||
24 | fstpl 120(%esp) | ||
25 | fldl 32(%ecx) | ||
26 | faddl crypto_scalarmult_curve25519_athlon_out4offset | ||
27 | fstpl 128(%esp) | ||
28 | fldl 40(%ecx) | ||
29 | faddl crypto_scalarmult_curve25519_athlon_out5offset | ||
30 | fstpl 136(%esp) | ||
31 | fldl 48(%ecx) | ||
32 | faddl crypto_scalarmult_curve25519_athlon_out6offset | ||
33 | fstpl 144(%esp) | ||
34 | fldl 56(%ecx) | ||
35 | faddl crypto_scalarmult_curve25519_athlon_out7offset | ||
36 | fstpl 152(%esp) | ||
37 | fldl 64(%ecx) | ||
38 | faddl crypto_scalarmult_curve25519_athlon_out8offset | ||
39 | fstpl 160(%esp) | ||
40 | fldl 72(%ecx) | ||
41 | faddl crypto_scalarmult_curve25519_athlon_out9offset | ||
42 | fstpl 168(%esp) | ||
43 | movl 96(%esp),%ecx | ||
44 | movl %ecx,4(%esp) | ||
45 | movl 104(%esp),%ecx | ||
46 | shl $26,%ecx | ||
47 | movl %ecx,40(%esp) | ||
48 | movl 104(%esp),%ecx | ||
49 | shr $6,%ecx | ||
50 | movl %ecx,8(%esp) | ||
51 | movl 112(%esp),%ecx | ||
52 | shl $19,%ecx | ||
53 | movl %ecx,44(%esp) | ||
54 | movl 112(%esp),%ecx | ||
55 | shr $13,%ecx | ||
56 | movl %ecx,12(%esp) | ||
57 | movl 120(%esp),%ecx | ||
58 | shl $13,%ecx | ||
59 | movl %ecx,48(%esp) | ||
60 | movl 120(%esp),%ecx | ||
61 | shr $19,%ecx | ||
62 | movl %ecx,16(%esp) | ||
63 | movl 128(%esp),%ecx | ||
64 | shl $6,%ecx | ||
65 | movl %ecx,52(%esp) | ||
66 | movl 128(%esp),%ecx | ||
67 | shr $26,%ecx | ||
68 | movl 136(%esp),%edx | ||
69 | add %edx,%ecx | ||
70 | movl %ecx,20(%esp) | ||
71 | movl 144(%esp),%ecx | ||
72 | shl $25,%ecx | ||
73 | movl %ecx,56(%esp) | ||
74 | movl 144(%esp),%ecx | ||
75 | shr $7,%ecx | ||
76 | movl %ecx,24(%esp) | ||
77 | movl 152(%esp),%ecx | ||
78 | shl $19,%ecx | ||
79 | movl %ecx,60(%esp) | ||
80 | movl 152(%esp),%ecx | ||
81 | shr $13,%ecx | ||
82 | movl %ecx,28(%esp) | ||
83 | movl 160(%esp),%ecx | ||
84 | shl $12,%ecx | ||
85 | movl %ecx,64(%esp) | ||
86 | movl 160(%esp),%ecx | ||
87 | shr $20,%ecx | ||
88 | movl %ecx,32(%esp) | ||
89 | movl 168(%esp),%ecx | ||
90 | shl $6,%ecx | ||
91 | movl %ecx,68(%esp) | ||
92 | movl 168(%esp),%ecx | ||
93 | shr $26,%ecx | ||
94 | movl %ecx,36(%esp) | ||
95 | mov $0,%ecx | ||
96 | movl %ecx,72(%esp) | ||
97 | movl 4(%esp),%ecx | ||
98 | addl 40(%esp),%ecx | ||
99 | movl %ecx,4(%esp) | ||
100 | movl 8(%esp),%ecx | ||
101 | adcl 44(%esp),%ecx | ||
102 | movl %ecx,8(%esp) | ||
103 | movl 12(%esp),%ecx | ||
104 | adcl 48(%esp),%ecx | ||
105 | movl %ecx,12(%esp) | ||
106 | movl 16(%esp),%ecx | ||
107 | adcl 52(%esp),%ecx | ||
108 | movl %ecx,16(%esp) | ||
109 | movl 20(%esp),%ecx | ||
110 | adcl 56(%esp),%ecx | ||
111 | movl %ecx,20(%esp) | ||
112 | movl 24(%esp),%ecx | ||
113 | adcl 60(%esp),%ecx | ||
114 | movl %ecx,24(%esp) | ||
115 | movl 28(%esp),%ecx | ||
116 | adcl 64(%esp),%ecx | ||
117 | movl %ecx,28(%esp) | ||
118 | movl 32(%esp),%ecx | ||
119 | adcl 68(%esp),%ecx | ||
120 | movl %ecx,32(%esp) | ||
121 | movl 36(%esp),%ecx | ||
122 | adcl 72(%esp),%ecx | ||
123 | movl %ecx,36(%esp) | ||
124 | movl 4(%esp),%ecx | ||
125 | adc $0x13,%ecx | ||
126 | movl %ecx,40(%esp) | ||
127 | movl 8(%esp),%ecx | ||
128 | adc $0,%ecx | ||
129 | movl %ecx,44(%esp) | ||
130 | movl 12(%esp),%ecx | ||
131 | adc $0,%ecx | ||
132 | movl %ecx,48(%esp) | ||
133 | movl 16(%esp),%ecx | ||
134 | adc $0,%ecx | ||
135 | movl %ecx,52(%esp) | ||
136 | movl 20(%esp),%ecx | ||
137 | adc $0,%ecx | ||
138 | movl %ecx,56(%esp) | ||
139 | movl 24(%esp),%ecx | ||
140 | adc $0,%ecx | ||
141 | movl %ecx,60(%esp) | ||
142 | movl 28(%esp),%ecx | ||
143 | adc $0,%ecx | ||
144 | movl %ecx,64(%esp) | ||
145 | movl 32(%esp),%ecx | ||
146 | adc $0x80000000,%ecx | ||
147 | movl %ecx,68(%esp) | ||
148 | movl 36(%esp),%ebp | ||
149 | adc $0xffffffff,%ebp | ||
150 | and $0x80000000,%ebp | ||
151 | sar $31,%ebp | ||
152 | movl 4(%esp,%eax),%ecx | ||
153 | movl 4(%esp),%edx | ||
154 | xorl 40(%esp),%edx | ||
155 | and %ebp,%edx | ||
156 | xorl 40(%esp),%edx | ||
157 | movl %edx,0(%ecx) | ||
158 | movl 8(%esp),%edx | ||
159 | xorl 44(%esp),%edx | ||
160 | and %ebp,%edx | ||
161 | xorl 44(%esp),%edx | ||
162 | movl %edx,4(%ecx) | ||
163 | movl 12(%esp),%edx | ||
164 | xorl 48(%esp),%edx | ||
165 | and %ebp,%edx | ||
166 | xorl 48(%esp),%edx | ||
167 | movl %edx,8(%ecx) | ||
168 | movl 16(%esp),%edx | ||
169 | xorl 52(%esp),%edx | ||
170 | and %ebp,%edx | ||
171 | xorl 52(%esp),%edx | ||
172 | movl %edx,12(%ecx) | ||
173 | movl 20(%esp),%edx | ||
174 | xorl 56(%esp),%edx | ||
175 | and %ebp,%edx | ||
176 | xorl 56(%esp),%edx | ||
177 | movl %edx,16(%ecx) | ||
178 | movl 24(%esp),%edx | ||
179 | xorl 60(%esp),%edx | ||
180 | and %ebp,%edx | ||
181 | xorl 60(%esp),%edx | ||
182 | movl %edx,20(%ecx) | ||
183 | movl 28(%esp),%edx | ||
184 | xorl 64(%esp),%edx | ||
185 | and %ebp,%edx | ||
186 | xorl 64(%esp),%edx | ||
187 | movl %edx,24(%ecx) | ||
188 | movl 32(%esp),%edx | ||
189 | xorl 68(%esp),%edx | ||
190 | and %ebp,%edx | ||
191 | xorl 68(%esp),%edx | ||
192 | movl %edx,28(%ecx) | ||
193 | movl 0(%esp),%ebp | ||
194 | add %eax,%esp | ||
195 | ret | ||