bigint_mod_multiply() and bigint_mod_exp() require a fixed amount of temporary storage for intermediate results. (The amount of temporary storage required depends upon the size of the integers involved.) When performing calculations for 4096-bit RSA the amount of temporary storage space required will exceed 2.5kB, which is too much to allocate on the stack. Avoid this problem by forcing the caller to allocate temporary storage. Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
35 |
|
35 |
|
36 |
|
36 |
|
37 |
|
37 |
|
|
38 |
|
|
|
39 |
|
|
38 |
|
40 |
|
39 |
|
41 |
|
40 |
|
42 |
|
41 |
|
43 |
|
42 |
|
44 |
|
43 |
|
|
|
|
45 |
|
|
44 |
|
46 |
|
45 |
|
47 |
|
46 |
|
48 |
|
|
|
||
49 |
|
51 |
|
50 |
|
52 |
|
51 |
|
53 |
|
52 |
|
|
|
53 |
|
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
54 |
|
58 |
|
55 |
|
59 |
|
56 |
|
60 |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
57 |
|
64 |
|
58 |
|
|
|
|
65 |
|
|
59 |
|
66 |
|
60 |
|
67 |
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
64 |
|
71 |
|
65 |
|
|
|
|
72 |
|
|
66 |
|
73 |
|
67 |
|
74 |
|
68 |
|
75 |
|
69 |
|
|
|
70 |
|
|
|
71 |
|
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
|
|
72 |
|
79 |
|
73 |
|
80 |
|
74 |
|
81 |
|
75 |
|
|
|
|
82 |
|
|
76 |
|
83 |
|
77 |
|
84 |
|
78 |
|
85 |
|
|
|
||
87 |
|
94 |
|
88 |
|
95 |
|
89 |
|
96 |
|
|
97 |
|
|
90 |
|
98 |
|
91 |
|
99 |
|
92 |
|
100 |
|
93 |
|
101 |
|
94 |
|
102 |
|
95 |
|
|
|
96 |
|
|
|
|
103 |
|
|
|
104 |
|
|
97 |
|
105 |
|
98 |
|
106 |
|
99 |
|
107 |
|
|
|
||
102 |
|
110 |
|
103 |
|
111 |
|
104 |
|
112 |
|
105 |
|
|
|
106 |
|
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
107 |
|
119 |
|
108 |
|
120 |
|
109 |
|
|
|
110 |
|
|
|
|
121 |
|
|
|
122 |
|
|
111 |
|
123 |
|
112 |
|
124 |
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
|
125 |
|
|
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
117 |
|
129 |
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
|
130 |
|
|
|
131 |
|
|
|
132 |
|
|
121 |
|
133 |
|
122 |
|
134 |
|
|
|
||
123 |
|
123 |
|
124 |
|
124 |
|
125 |
|
125 |
|
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
126 |
|
129 |
|
127 |
|
130 |
|
128 |
|
131 |
|
129 |
|
132 |
|
130 |
|
133 |
|
|
134 |
|
|
131 |
|
135 |
|
132 |
|
136 |
|
133 |
|
137 |
|
|
|
||
147 |
|
151 |
|
148 |
|
152 |
|
149 |
|
153 |
|
|
154 |
|
|
150 |
|
155 |
|
151 |
|
156 |
|
152 |
|
157 |
|
|
|
||
309 |
|
314 |
|
310 |
|
315 |
|
311 |
|
316 |
|
312 |
|
|
|
|
317 |
|
|
313 |
|
318 |
|
314 |
|
319 |
|
315 |
|
320 |
|
|
|
||
197 |
|
197 |
|
198 |
|
198 |
|
199 |
|
199 |
|
|
200 |
|
|
200 |
|
201 |
|
201 |
|
202 |
|
202 |
|
|
|
|
203 |
|
|
203 |
|
204 |
|
204 |
|
205 |
|
205 |
|
206 |
|
206 |
|
207 |
|
207 |
|
|
|
|
208 |
|
|
208 |
|
209 |
|
209 |
|
210 |
|
|
211 |
|
|
|
212 |
|
|
|
213 |
|
|
|
214 |
|
|
|
215 |
|
|
|
216 |
|
|
|
217 |
|
|
|
218 |
|
|
|
219 |
|
|
|
220 |
|
|
|
221 |
|
|
|
222 |
|
|
|
223 |
|
|
210 |
|
224 |
|
211 |
|
225 |
|
212 |
|
226 |
|
|
|
||
214 |
|
228 |
|
215 |
|
229 |
|
216 |
|
230 |
|
|
231 |
|
|
217 |
|
232 |
|
218 |
|
|
|
|
233 |
|
|
219 |
|
234 |
|
220 |
|
235 |
|
221 |
|
236 |
|
222 |
|
|
|
223 |
|
|
|
|
237 |
|
|
|
238 |
|
|
224 |
|
239 |
|
225 |
|
240 |
|
|
241 |
|
|
|
242 |
|
|
|
243 |
|
|
|
244 |
|
|
|
245 |
|
|
|
246 |
|
|
|
247 |
|
|
|
248 |
|
|
|
249 |
|
|
|
250 |
|
|
|
251 |
|
|
|
252 |
|
|
|
253 |
|
|
|
254 |
|
|
|
255 |
|
|
|
256 |
|
|
|
257 |
|
|
|
258 |
|
|
226 |
|
259 |
|
227 |
|
260 |
|
228 |
|
261 |
|
|
|
||
257 |
|
290 |
|
258 |
|
291 |
|
259 |
|
292 |
|
260 |
|
|
|
|
293 |
|
|
261 |
|
294 |
|
262 |
|
295 |
|
263 |
|
296 |
|
264 |
|
297 |
|
265 |
|
|
|
266 |
|
|
|
|
298 |
|
|
|
299 |
|
|
267 |
|
300 |
|
268 |
|
301 |
|
|
|
||
129 |
|
129 |
|
130 |
|
130 |
|
131 |
|
131 |
|
|
132 |
|
|
|
133 |
|
|
132 |
|
134 |
|
133 |
|
135 |
|
134 |
|
136 |
|
|
|
||
162 |
|
162 |
|
163 |
|
163 |
|
164 |
|
164 |
|
165 |
|
|
|
|
165 |
|
|
|
166 |
|
|
166 |
|
167 |
|
167 |
|
168 |
|
168 |
|
169 |
|
|
|
||
172 |
|
173 |
|
173 |
|
174 |
|
174 |
|
175 |
|
175 |
|
|
|
|
176 |
|
|
176 |
|
177 |
|
177 |
|
178 |
|
178 |
|
179 |
|
179 |
|
180 |
|
180 |
|
181 |
|
181 |
|
182 |
|
182 |
|
|
|
|
183 |
|
|
|
184 |
|
|
183 |
|
185 |
|
184 |
|
186 |
|
185 |
|
187 |
|
|
|
||
189 |
|
191 |
|
190 |
|
192 |
|
191 |
|
193 |
|
192 |
|
|
|
|
194 |
|
|
193 |
|
195 |
|
194 |
|
196 |
|
195 |
|
197 |
|
|
|
||
471 |
|
473 |
|
472 |
|
474 |
|
473 |
|
475 |
|
|
476 |
|
|
|
477 |
|
|
474 |
|
478 |
|
475 |
|
479 |
|
476 |
|
480 |
|
|
|
||
490 |
|
494 |
|
491 |
|
495 |
|
492 |
|
496 |
|
493 |
|
|
|
|
497 |
|
|
494 |
|
498 |
|
495 |
|
499 |
|
496 |
|
500 |
|
|
|
||
520 |
|
524 |
|
521 |
|
525 |
|
522 |
|
526 |
|
|
527 |
|
|
|
528 |
|
|
|
529 |
|
|
523 |
|
530 |
|
524 |
|
531 |
|
525 |
|
532 |
|
|
|
||
536 |
|
543 |
|
537 |
|
544 |
|
538 |
|
545 |
|
539 |
|
|
|
|
546 |
|
|
540 |
|
547 |
|
541 |
|
548 |
|
542 |
|
549 |
|