Lines Matching refs:size
21 #define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \ argument
23 if ((size) < KARATSUBA_THRESHOLD) \
24 mul_n_basecase(prodp, up, vp, size); \
26 mul_n(prodp, up, vp, size, tspace); \
29 #define MPN_SQR_N_RECURSE(prodp, up, size, tspace) \ argument
31 if ((size) < KARATSUBA_THRESHOLD) \
32 mpih_sqr_n_basecase(prodp, up, size); \
34 mpih_sqr_n(prodp, up, size, tspace); \
55 mul_n_basecase(mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size) in mul_n_basecase() argument
66 MPN_COPY(prodp, up, size); in mul_n_basecase()
68 MPN_ZERO(prodp, size); in mul_n_basecase()
71 cy = mpihelp_mul_1(prodp, up, size, v_limb); in mul_n_basecase()
73 prodp[size] = cy; in mul_n_basecase()
78 for (i = 1; i < size; i++) { in mul_n_basecase()
83 cy = mpihelp_add_n(prodp, prodp, up, size); in mul_n_basecase()
85 cy = mpihelp_addmul_1(prodp, up, size, v_limb); in mul_n_basecase()
87 prodp[size] = cy; in mul_n_basecase()
96 mpi_size_t size, mpi_ptr_t tspace) in mul_n() argument
98 if (size & 1) { in mul_n()
109 mpi_size_t esize = size - 1; /* even size */ in mul_n()
115 cy_limb = mpihelp_addmul_1(prodp + esize, vp, size, up[esize]); in mul_n()
116 prodp[esize + size] = cy_limb; in mul_n()
133 mpi_size_t hsize = size >> 1; in mul_n()
142 MPN_MUL_N_RECURSE(prodp + size, up + hsize, vp + hsize, hsize, in mul_n()
167 tspace + size); in mul_n()
170 MPN_COPY(prodp + hsize, prodp + size, hsize); in mul_n()
171 cy = mpihelp_add_n(prodp + size, prodp + size, in mul_n()
172 prodp + size + hsize, hsize); in mul_n()
178 size); in mul_n()
182 size); in mul_n()
190 MPN_MUL_N_RECURSE(tspace, up, vp, hsize, tspace + size); in mul_n()
194 cy += mpihelp_add_n(prodp + hsize, prodp + hsize, tspace, size); in mul_n()
196 mpihelp_add_1(prodp + hsize + size, in mul_n()
197 prodp + hsize + size, hsize, cy); in mul_n()
203 mpihelp_add_1(prodp + size, prodp + size, size, 1); in mul_n()
207 void mpih_sqr_n_basecase(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size) in mpih_sqr_n_basecase() argument
218 MPN_COPY(prodp, up, size); in mpih_sqr_n_basecase()
220 MPN_ZERO(prodp, size); in mpih_sqr_n_basecase()
223 cy_limb = mpihelp_mul_1(prodp, up, size, v_limb); in mpih_sqr_n_basecase()
225 prodp[size] = cy_limb; in mpih_sqr_n_basecase()
230 for (i = 1; i < size; i++) { in mpih_sqr_n_basecase()
235 cy_limb = mpihelp_add_n(prodp, prodp, up, size); in mpih_sqr_n_basecase()
237 cy_limb = mpihelp_addmul_1(prodp, up, size, v_limb); in mpih_sqr_n_basecase()
239 prodp[size] = cy_limb; in mpih_sqr_n_basecase()
245 mpih_sqr_n(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size, mpi_ptr_t tspace) in mpih_sqr_n() argument
247 if (size & 1) { in mpih_sqr_n()
258 mpi_size_t esize = size - 1; /* even size */ in mpih_sqr_n()
264 cy_limb = mpihelp_addmul_1(prodp + esize, up, size, up[esize]); in mpih_sqr_n()
266 prodp[esize + size] = cy_limb; in mpih_sqr_n()
268 mpi_size_t hsize = size >> 1; in mpih_sqr_n()
276 MPN_SQR_N_RECURSE(prodp + size, up + hsize, hsize, tspace); in mpih_sqr_n()
289 MPN_SQR_N_RECURSE(tspace, prodp, hsize, tspace + size); in mpih_sqr_n()
292 MPN_COPY(prodp + hsize, prodp + size, hsize); in mpih_sqr_n()
293 cy = mpihelp_add_n(prodp + size, prodp + size, in mpih_sqr_n()
294 prodp + size + hsize, hsize); in mpih_sqr_n()
297 cy -= mpihelp_sub_n(prodp + hsize, prodp + hsize, tspace, size); in mpih_sqr_n()
304 MPN_SQR_N_RECURSE(tspace, up, hsize, tspace + size); in mpih_sqr_n()
307 cy += mpihelp_add_n(prodp + hsize, prodp + hsize, tspace, size); in mpih_sqr_n()
309 mpihelp_add_1(prodp + hsize + size, in mpih_sqr_n()
310 prodp + hsize + size, hsize, cy); in mpih_sqr_n()
316 mpihelp_add_1(prodp + size, prodp + size, size, 1); in mpih_sqr_n()
322 mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size) in mpihelp_mul_n() argument
325 if (size < KARATSUBA_THRESHOLD) in mpihelp_mul_n()
326 mpih_sqr_n_basecase(prodp, up, size); in mpihelp_mul_n()
329 tspace = mpi_alloc_limb_space(2 * size); in mpihelp_mul_n()
330 mpih_sqr_n(prodp, up, size, tspace); in mpihelp_mul_n()
334 if (size < KARATSUBA_THRESHOLD) in mpihelp_mul_n()
335 mul_n_basecase(prodp, up, vp, size); in mpihelp_mul_n()
338 tspace = mpi_alloc_limb_space(2 * size); in mpihelp_mul_n()
339 mul_n(prodp, up, vp, size, tspace); in mpihelp_mul_n()