Lines Matching +full:1 +full:ma
99 * that x-1 is not a multiple of 65537.
105 mpz_urandomb(x, RNG, size - 1); in rand_prime()
107 mpz_setbit(x, size - 1); in rand_prime()
109 mpz_sub_ui(x, x, 1); in rand_prime()
113 mpz_add_ui(x, x, 1); in rand_prime()
128 mpz_export(zb, &zlen, 1, 1, 0, 0, z); in print_z()
141 zb[k], zb[k + 1], zb[k + 2], zb[k + 3]); in print_z()
176 mpz_export(zb, &zlen, 1, 1, 0, 0, z); in check_eqz()
177 good = 1; in check_eqz()
222 mpz_export(mx + 1, &xlen, -1, sizeof *mx, 0, 1, x);
247 uint32_t mp[40], ma[40], mb[40], mv[60], mx[100]; in test_modint() local
257 mpz_set_ui(b, 1); in test_modint()
259 mpz_export(ep, &plen, 1, 1, 0, 0, p); in test_modint()
260 mpz_export(ea, &alen, 1, 1, 0, 0, a); in test_modint()
261 mpz_export(eb, &blen, 1, 1, 0, 0, b); in test_modint()
262 mpz_export(ev, &vlen, 1, 1, 0, 0, v); in test_modint()
265 if (impl->decode_mod(ma, ea, alen, mp) != 1) { in test_modint()
275 mp0i = impl->ninv(mp[1]); in test_modint()
276 if (impl->decode_mod(mb, eb, blen, mp) != 1) { in test_modint()
288 check_eqz(ma, a); in test_modint()
292 impl->decode_mod(ma, ea, alen, mp); in test_modint()
294 ctl = impl->add(ma, mb, 1); in test_modint()
295 ctl |= impl->sub(ma, mp, 0) ^ (uint32_t)1; in test_modint()
296 impl->sub(ma, mp, ctl); in test_modint()
299 check_eqz(ma, t1); in test_modint()
301 impl->decode_mod(ma, ea, alen, mp); in test_modint()
303 impl->add(ma, mp, impl->sub(ma, mb, 1)); in test_modint()
306 check_eqz(ma, t1); in test_modint()
308 impl->decode_reduce(ma, ev, vlen, mp); in test_modint()
310 check_eqz(ma, t1); in test_modint()
313 impl->reduce(ma, mv, mp); in test_modint()
315 check_eqz(ma, t1); in test_modint()
317 impl->decode_mod(ma, ea, alen, mp); in test_modint()
318 impl->to_monty(ma, mp); in test_modint()
319 mpz_mul_2exp(t1, a, ((k + impl->word_size - 1) in test_modint()
322 check_eqz(ma, t1); in test_modint()
323 impl->from_monty(ma, mp, mp0i); in test_modint()
324 check_eqz(ma, a); in test_modint()
326 impl->decode_mod(ma, ea, alen, mp); in test_modint()
328 impl->to_monty(ma, mp); in test_modint()
329 impl->montymul(mt1, ma, mb, mp, mp0i); in test_modint()
334 impl->decode_mod(ma, ea, alen, mp); in test_modint()
335 impl->modpow(ma, ev, vlen, mp, mp0i, mt1, mt2); in test_modint()
337 check_eqz(ma, t1); in test_modint()
340 br_modint_decode(ma, mp, ea, alen); in test_modint()
342 if (!br_modint_div(ma, mb, mp, mt1, mt2, mt3)) { in test_modint()
350 check_eqz(ma, t1); in test_modint()
352 br_modint_decode(ma, mp, ea, alen); in test_modint()
355 br_int_add(mx, j, ma, mb); in test_modint()
360 br_int_mul(mx, j, ma, mb); in test_modint()
430 mpz_sub_ui(t1, p, 1);
431 mpz_sub_ui(t2, q, 1);