{
case 1:
/* Deprecated-style callbacks */
+ if(!cb->cb.cb_1)
+ return 1;
cb->cb.cb_1(a, b, cb->arg);
return 1;
case 2:
BN_CTX *ctx;
int checks = BN_prime_checks_for_size(bits);
+ BN_init(&t);
ctx=BN_CTX_new();
if (ctx == NULL) goto err;
- BN_init(&t);
loop:
/* make a random number and set the top and bottom bits */
if (add == NULL)
err:
BN_free(&t);
if (ctx != NULL) BN_CTX_free(ctx);
+ bn_check_top(ret);
return found;
}
}
/* If we get here, 'w' is the (a-1)/2-th power of the original 'w',
* and it is neither -1 nor +1 -- so 'a' cannot be prime */
+ bn_check_top(w);
return 1;
}
}
}
if (!BN_add_word(rnd,delta)) return(0);
+ bn_check_top(rnd);
return(1);
}
ret=1;
err:
BN_CTX_end(ctx);
+ bn_check_top(rnd);
return(ret);
}
ret=1;
err:
BN_CTX_end(ctx);
+ bn_check_top(p);
return(ret);
}