Home | History | Annotate | Download | only in bn

Lines Matching refs:ctx

130 	const BIGNUM *a1_odd, int k, BN_CTX *ctx, BN_MONT_CTX *mont);
133 const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
135 const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
165 BN_CTX *ctx;
168 ctx=BN_CTX_new();
169 if (ctx == NULL) goto err;
170 BN_CTX_start(ctx);
171 t = BN_CTX_get(ctx);
183 if (!probable_prime_dh_safe(ret,bits,add,rem,ctx))
188 if (!probable_prime_dh(ret,bits,add,rem,ctx))
199 i=BN_is_prime_fasttest_ex(ret,checks,ctx,0,cb);
213 j=BN_is_prime_fasttest_ex(ret,1,ctx,0,cb);
217 j=BN_is_prime_fasttest_ex(t,1,ctx,0,cb);
229 if (ctx != NULL)
231 BN_CTX_end(ctx);
232 BN_CTX_free(ctx);
248 BN_CTX *ctx = NULL;
249 BIGNUM *A1, *A1_odd, *check; /* taken from ctx */
273 ctx = ctx_passed;
275 if ((ctx=BN_CTX_new()) == NULL)
277 BN_CTX_start(ctx);
283 if ((t = BN_CTX_get(ctx)) == NULL) goto err;
290 A1 = BN_CTX_get(ctx);
291 A1_odd = BN_CTX_get(ctx);
292 check = BN_CTX_get(ctx);
317 if (!BN_MONT_CTX_set(mont, A, ctx))
328 j = witness(check, A, A1, A1_odd, k, ctx, mont);
340 if (ctx != NULL)
342 BN_CTX_end(ctx);
344 BN_CTX_free(ctx);
353 const BIGNUM *a1_odd, int k, BN_CTX *ctx, BN_MONT_CTX *mont)
355 if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
363 if (!BN_mod_mul(w, w, w, a, ctx)) /* w := w^2 mod a */
407 const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)
412 BN_CTX_start(ctx);
413 if ((t1 = BN_CTX_get(ctx)) == NULL) goto err;
419 if (!BN_mod(t1,rnd,add,ctx)) goto err;
439 BN_CTX_end(ctx);
445 const BIGNUM *rem, BN_CTX *ctx)
451 BN_CTX_start(ctx);
452 t1 = BN_CTX_get(ctx);
453 q = BN_CTX_get(ctx);
454 qadd = BN_CTX_get(ctx);
462 if (!BN_mod(t1,q,qadd,ctx)) goto err;
491 BN_CTX_end(ctx);